{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d1f5045f",
   "metadata": {},
   "source": [
    "### 观察标准库\n",
    "##### [学习文档1](https://blog.csdn.net/liujinwei2005/article/details/76725422)\n",
    "##### [学习文档2](https://blog.csdn.net/jurbo/article/details/52334345)\n",
    "##### [菜鸟文档——python学习](https://www.runoob.com/python3/python3-stdlib.html)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dd8bd595",
   "metadata": {},
   "source": [
    "#### 1. os操作系统接口  \n",
    "* os模块提供了不少与操作系统相关联的函数\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "45d0b048",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\LZ\\\\Python课程\\\\练习'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "os.getcwd() # 用于返回当前的文件的目录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6a9d8e3d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on module os:\n",
      "\n",
      "NAME\n",
      "    os - OS routines for NT or Posix depending on what system we're on.\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/os\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "DESCRIPTION\n",
      "    This exports:\n",
      "      - all functions from posix or nt, e.g. unlink, stat, etc.\n",
      "      - os.path is either posixpath or ntpath\n",
      "      - os.name is either 'posix' or 'nt'\n",
      "      - os.curdir is a string representing the current directory (always '.')\n",
      "      - os.pardir is a string representing the parent directory (always '..')\n",
      "      - os.sep is the (or a most common) pathname separator ('/' or '\\\\')\n",
      "      - os.extsep is the extension separator (always '.')\n",
      "      - os.altsep is the alternate pathname separator (None or '/')\n",
      "      - os.pathsep is the component separator used in $PATH etc\n",
      "      - os.linesep is the line separator in text files ('\\r' or '\\n' or '\\r\\n')\n",
      "      - os.defpath is the default search path for executables\n",
      "      - os.devnull is the file path of the null device ('/dev/null', etc.)\n",
      "    \n",
      "    Programs that import and use 'os' stand a better chance of being\n",
      "    portable between different platforms.  Of course, they must then\n",
      "    only use functions that are defined by all platforms (e.g., unlink\n",
      "    and opendir), and leave all pathname manipulation to os.path\n",
      "    (e.g., split and join).\n",
      "\n",
      "CLASSES\n",
      "    builtins.Exception(builtins.BaseException)\n",
      "        builtins.OSError\n",
      "    builtins.object\n",
      "        nt.DirEntry\n",
      "    builtins.tuple(builtins.object)\n",
      "        nt.times_result\n",
      "        nt.uname_result\n",
      "        stat_result\n",
      "        statvfs_result\n",
      "        terminal_size\n",
      "    \n",
      "    class DirEntry(builtins.object)\n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __fspath__(self, /)\n",
      "     |      Returns the path for the entry.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  inode(self, /)\n",
      "     |      Return inode of the entry; cached per entry.\n",
      "     |  \n",
      "     |  is_dir(self, /, *, follow_symlinks=True)\n",
      "     |      Return True if the entry is a directory; cached per entry.\n",
      "     |  \n",
      "     |  is_file(self, /, *, follow_symlinks=True)\n",
      "     |      Return True if the entry is a file; cached per entry.\n",
      "     |  \n",
      "     |  is_symlink(self, /)\n",
      "     |      Return True if the entry is a symbolic link; cached per entry.\n",
      "     |  \n",
      "     |  stat(self, /, *, follow_symlinks=True)\n",
      "     |      Return stat_result object for the entry; cached per entry.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  name\n",
      "     |      the entry's base filename, relative to scandir() \"path\" argument\n",
      "     |  \n",
      "     |  path\n",
      "     |      the entry's full path name; equivalent to os.path.join(scandir_path, entry.name)\n",
      "    \n",
      "    error = class OSError(Exception)\n",
      "     |  Base class for I/O related errors.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      OSError\n",
      "     |      Exception\n",
      "     |      BaseException\n",
      "     |      object\n",
      "     |  \n",
      "     |  Built-in subclasses:\n",
      "     |      BlockingIOError\n",
      "     |      ChildProcessError\n",
      "     |      ConnectionError\n",
      "     |      FileExistsError\n",
      "     |      ... and 7 other subclasses\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, /, *args, **kwargs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  characters_written\n",
      "     |  \n",
      "     |  errno\n",
      "     |      POSIX exception code\n",
      "     |  \n",
      "     |  filename\n",
      "     |      exception filename\n",
      "     |  \n",
      "     |  filename2\n",
      "     |      second exception filename\n",
      "     |  \n",
      "     |  strerror\n",
      "     |      exception strerror\n",
      "     |  \n",
      "     |  winerror\n",
      "     |      Win32 exception code\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "    \n",
      "    class stat_result(builtins.tuple)\n",
      "     |  stat_result(iterable=(), /)\n",
      "     |  \n",
      "     |  stat_result: Result from stat, fstat, or lstat.\n",
      "     |  \n",
      "     |  This object may be accessed either as a tuple of\n",
      "     |    (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)\n",
      "     |  or via the attributes st_mode, st_ino, st_dev, st_nlink, st_uid, and so on.\n",
      "     |  \n",
      "     |  Posix/windows: If your platform supports st_blksize, st_blocks, st_rdev,\n",
      "     |  or st_flags, they are available as attributes only.\n",
      "     |  \n",
      "     |  See os.stat for more information.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      stat_result\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  st_atime\n",
      "     |      time of last access\n",
      "     |  \n",
      "     |  st_atime_ns\n",
      "     |      time of last access in nanoseconds\n",
      "     |  \n",
      "     |  st_ctime\n",
      "     |      time of last change\n",
      "     |  \n",
      "     |  st_ctime_ns\n",
      "     |      time of last change in nanoseconds\n",
      "     |  \n",
      "     |  st_dev\n",
      "     |      device\n",
      "     |  \n",
      "     |  st_file_attributes\n",
      "     |      Windows file attribute bits\n",
      "     |  \n",
      "     |  st_gid\n",
      "     |      group ID of owner\n",
      "     |  \n",
      "     |  st_ino\n",
      "     |      inode\n",
      "     |  \n",
      "     |  st_mode\n",
      "     |      protection bits\n",
      "     |  \n",
      "     |  st_mtime\n",
      "     |      time of last modification\n",
      "     |  \n",
      "     |  st_mtime_ns\n",
      "     |      time of last modification in nanoseconds\n",
      "     |  \n",
      "     |  st_nlink\n",
      "     |      number of hard links\n",
      "     |  \n",
      "     |  st_reparse_tag\n",
      "     |      Windows reparse tag\n",
      "     |  \n",
      "     |  st_size\n",
      "     |      total size, in bytes\n",
      "     |  \n",
      "     |  st_uid\n",
      "     |      user ID of owner\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 18\n",
      "     |  \n",
      "     |  n_sequence_fields = 10\n",
      "     |  \n",
      "     |  n_unnamed_fields = 3\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "    \n",
      "    class statvfs_result(builtins.tuple)\n",
      "     |  statvfs_result(iterable=(), /)\n",
      "     |  \n",
      "     |  statvfs_result: Result from statvfs or fstatvfs.\n",
      "     |  \n",
      "     |  This object may be accessed either as a tuple of\n",
      "     |    (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax),\n",
      "     |  or via the attributes f_bsize, f_frsize, f_blocks, f_bfree, and so on.\n",
      "     |  \n",
      "     |  See os.statvfs for more information.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      statvfs_result\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  f_bavail\n",
      "     |  \n",
      "     |  f_bfree\n",
      "     |  \n",
      "     |  f_blocks\n",
      "     |  \n",
      "     |  f_bsize\n",
      "     |  \n",
      "     |  f_favail\n",
      "     |  \n",
      "     |  f_ffree\n",
      "     |  \n",
      "     |  f_files\n",
      "     |  \n",
      "     |  f_flag\n",
      "     |  \n",
      "     |  f_frsize\n",
      "     |  \n",
      "     |  f_fsid\n",
      "     |  \n",
      "     |  f_namemax\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 11\n",
      "     |  \n",
      "     |  n_sequence_fields = 10\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "    \n",
      "    class terminal_size(builtins.tuple)\n",
      "     |  terminal_size(iterable=(), /)\n",
      "     |  \n",
      "     |  A tuple of (columns, lines) for holding terminal window size\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      terminal_size\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  columns\n",
      "     |      width of the terminal window in characters\n",
      "     |  \n",
      "     |  lines\n",
      "     |      height of the terminal window in characters\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 2\n",
      "     |  \n",
      "     |  n_sequence_fields = 2\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "    \n",
      "    class times_result(builtins.tuple)\n",
      "     |  times_result(iterable=(), /)\n",
      "     |  \n",
      "     |  times_result: Result from os.times().\n",
      "     |  \n",
      "     |  This object may be accessed either as a tuple of\n",
      "     |    (user, system, children_user, children_system, elapsed),\n",
      "     |  or via the attributes user, system, children_user, children_system,\n",
      "     |  and elapsed.\n",
      "     |  \n",
      "     |  See os.times for more information.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      times_result\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  children_system\n",
      "     |      system time of children\n",
      "     |  \n",
      "     |  children_user\n",
      "     |      user time of children\n",
      "     |  \n",
      "     |  elapsed\n",
      "     |      elapsed time since an arbitrary point in the past\n",
      "     |  \n",
      "     |  system\n",
      "     |      system time\n",
      "     |  \n",
      "     |  user\n",
      "     |      user time\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 5\n",
      "     |  \n",
      "     |  n_sequence_fields = 5\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "    \n",
      "    class uname_result(builtins.tuple)\n",
      "     |  uname_result(iterable=(), /)\n",
      "     |  \n",
      "     |  uname_result: Result from os.uname().\n",
      "     |  \n",
      "     |  This object may be accessed either as a tuple of\n",
      "     |    (sysname, nodename, release, version, machine),\n",
      "     |  or via the attributes sysname, nodename, release, version, and machine.\n",
      "     |  \n",
      "     |  See os.uname for more information.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      uname_result\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  machine\n",
      "     |      hardware identifier\n",
      "     |  \n",
      "     |  nodename\n",
      "     |      name of machine on network (implementation-defined)\n",
      "     |  \n",
      "     |  release\n",
      "     |      operating system release\n",
      "     |  \n",
      "     |  sysname\n",
      "     |      operating system name\n",
      "     |  \n",
      "     |  version\n",
      "     |      operating system version\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 5\n",
      "     |  \n",
      "     |  n_sequence_fields = 5\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "\n",
      "FUNCTIONS\n",
      "    _exit(status)\n",
      "        Exit to the system with specified status, without normal exit processing.\n",
      "    \n",
      "    abort()\n",
      "        Abort the interpreter immediately.\n",
      "        \n",
      "        This function 'dumps core' or otherwise fails in the hardest way possible\n",
      "        on the hosting operating system.  This function never returns.\n",
      "    \n",
      "    access(path, mode, *, dir_fd=None, effective_ids=False, follow_symlinks=True)\n",
      "        Use the real uid/gid to test for access to a path.\n",
      "        \n",
      "          path\n",
      "            Path to be tested; can be string, bytes, or a path-like object.\n",
      "          mode\n",
      "            Operating-system mode bitfield.  Can be F_OK to test existence,\n",
      "            or the inclusive-OR of R_OK, W_OK, and X_OK.\n",
      "          dir_fd\n",
      "            If not None, it should be a file descriptor open to a directory,\n",
      "            and path should be relative; path will then be relative to that\n",
      "            directory.\n",
      "          effective_ids\n",
      "            If True, access will use the effective uid/gid instead of\n",
      "            the real uid/gid.\n",
      "          follow_symlinks\n",
      "            If False, and the last element of the path is a symbolic link,\n",
      "            access will examine the symbolic link itself instead of the file\n",
      "            the link points to.\n",
      "        \n",
      "        dir_fd, effective_ids, and follow_symlinks may not be implemented\n",
      "          on your platform.  If they are unavailable, using them will raise a\n",
      "          NotImplementedError.\n",
      "        \n",
      "        Note that most operations will use the effective uid/gid, therefore this\n",
      "          routine can be used in a suid/sgid environment to test if the invoking user\n",
      "          has the specified access to the path.\n",
      "    \n",
      "    chdir(path)\n",
      "        Change the current working directory to the specified path.\n",
      "        \n",
      "        path may always be specified as a string.\n",
      "        On some platforms, path may also be specified as an open file descriptor.\n",
      "          If this functionality is unavailable, using it raises an exception.\n",
      "    \n",
      "    chmod(path, mode, *, dir_fd=None, follow_symlinks=True)\n",
      "        Change the access permissions of a file.\n",
      "        \n",
      "          path\n",
      "            Path to be modified.  May always be specified as a str, bytes, or a path-like object.\n",
      "            On some platforms, path may also be specified as an open file descriptor.\n",
      "            If this functionality is unavailable, using it raises an exception.\n",
      "          mode\n",
      "            Operating-system mode bitfield.\n",
      "          dir_fd\n",
      "            If not None, it should be a file descriptor open to a directory,\n",
      "            and path should be relative; path will then be relative to that\n",
      "            directory.\n",
      "          follow_symlinks\n",
      "            If False, and the last element of the path is a symbolic link,\n",
      "            chmod will modify the symbolic link itself instead of the file\n",
      "            the link points to.\n",
      "        \n",
      "        It is an error to use dir_fd or follow_symlinks when specifying path as\n",
      "          an open file descriptor.\n",
      "        dir_fd and follow_symlinks may not be implemented on your platform.\n",
      "          If they are unavailable, using them will raise a NotImplementedError.\n",
      "    \n",
      "    close(fd)\n",
      "        Close a file descriptor.\n",
      "    \n",
      "    closerange(fd_low, fd_high, /)\n",
      "        Closes all file descriptors in [fd_low, fd_high), ignoring errors.\n",
      "    \n",
      "    cpu_count()\n",
      "        Return the number of CPUs in the system; return None if indeterminable.\n",
      "        \n",
      "        This number is not equivalent to the number of CPUs the current process can\n",
      "        use.  The number of usable CPUs can be obtained with\n",
      "        ``len(os.sched_getaffinity(0))``\n",
      "    \n",
      "    device_encoding(fd)\n",
      "        Return a string describing the encoding of a terminal's file descriptor.\n",
      "        \n",
      "        The file descriptor must be attached to a terminal.\n",
      "        If the device is not a terminal, return None.\n",
      "    \n",
      "    dup(fd, /)\n",
      "        Return a duplicate of a file descriptor.\n",
      "    \n",
      "    dup2(fd, fd2, inheritable=True)\n",
      "        Duplicate file descriptor.\n",
      "    \n",
      "    execl(file, *args)\n",
      "        execl(file, *args)\n",
      "        \n",
      "        Execute the executable file with argument list args, replacing the\n",
      "        current process.\n",
      "    \n",
      "    execle(file, *args)\n",
      "        execle(file, *args, env)\n",
      "        \n",
      "        Execute the executable file with argument list args and\n",
      "        environment env, replacing the current process.\n",
      "    \n",
      "    execlp(file, *args)\n",
      "        execlp(file, *args)\n",
      "        \n",
      "        Execute the executable file (which is searched for along $PATH)\n",
      "        with argument list args, replacing the current process.\n",
      "    \n",
      "    execlpe(file, *args)\n",
      "        execlpe(file, *args, env)\n",
      "        \n",
      "        Execute the executable file (which is searched for along $PATH)\n",
      "        with argument list args and environment env, replacing the current\n",
      "        process.\n",
      "    \n",
      "    execv(path, argv, /)\n",
      "        Execute an executable path with arguments, replacing current process.\n",
      "        \n",
      "        path\n",
      "          Path of executable file.\n",
      "        argv\n",
      "          Tuple or list of strings.\n",
      "    \n",
      "    execve(path, argv, env)\n",
      "        Execute an executable path with arguments, replacing current process.\n",
      "        \n",
      "        path\n",
      "          Path of executable file.\n",
      "        argv\n",
      "          Tuple or list of strings.\n",
      "        env\n",
      "          Dictionary of strings mapping to strings.\n",
      "    \n",
      "    execvp(file, args)\n",
      "        execvp(file, args)\n",
      "        \n",
      "        Execute the executable file (which is searched for along $PATH)\n",
      "        with argument list args, replacing the current process.\n",
      "        args may be a list or tuple of strings.\n",
      "    \n",
      "    execvpe(file, args, env)\n",
      "        execvpe(file, args, env)\n",
      "        \n",
      "        Execute the executable file (which is searched for along $PATH)\n",
      "        with argument list args and environment env, replacing the\n",
      "        current process.\n",
      "        args may be a list or tuple of strings.\n",
      "    \n",
      "    fdopen(fd, *args, **kwargs)\n",
      "        # Supply os.fdopen()\n",
      "    \n",
      "    fsdecode(filename)\n",
      "        Decode filename (an os.PathLike, bytes, or str) from the filesystem\n",
      "        encoding with 'surrogateescape' error handler, return str unchanged. On\n",
      "        Windows, use 'strict' error handler if the file system encoding is\n",
      "        'mbcs' (which is the default encoding).\n",
      "    \n",
      "    fsencode(filename)\n",
      "        Encode filename (an os.PathLike, bytes, or str) to the filesystem\n",
      "        encoding with 'surrogateescape' error handler, return bytes unchanged.\n",
      "        On Windows, use 'strict' error handler if the file system encoding is\n",
      "        'mbcs' (which is the default encoding).\n",
      "    \n",
      "    fspath(path)\n",
      "        Return the file system path representation of the object.\n",
      "        \n",
      "        If the object is str or bytes, then allow it to pass through as-is. If the\n",
      "        object defines __fspath__(), then return the result of that method. All other\n",
      "        types raise a TypeError.\n",
      "    \n",
      "    fstat(fd)\n",
      "        Perform a stat system call on the given file descriptor.\n",
      "        \n",
      "        Like stat(), but for an open file descriptor.\n",
      "        Equivalent to os.stat(fd).\n",
      "    \n",
      "    fsync(fd)\n",
      "        Force write of fd to disk.\n",
      "    \n",
      "    ftruncate(fd, length, /)\n",
      "        Truncate a file, specified by file descriptor, to a specific length.\n",
      "    \n",
      "    get_exec_path(env=None)\n",
      "        Returns the sequence of directories that will be searched for the\n",
      "        named executable (similar to a shell) when launching a process.\n",
      "        \n",
      "        *env* must be an environment variable dict or None.  If *env* is None,\n",
      "        os.environ will be used.\n",
      "    \n",
      "    get_handle_inheritable(handle, /)\n",
      "        Get the close-on-exe flag of the specified file descriptor.\n",
      "    \n",
      "    get_inheritable(fd, /)\n",
      "        Get the close-on-exe flag of the specified file descriptor.\n",
      "    \n",
      "    get_terminal_size(...)\n",
      "        Return the size of the terminal window as (columns, lines).\n",
      "        \n",
      "        The optional argument fd (default standard output) specifies\n",
      "        which file descriptor should be queried.\n",
      "        \n",
      "        If the file descriptor is not connected to a terminal, an OSError\n",
      "        is thrown.\n",
      "        \n",
      "        This function will only be defined if an implementation is\n",
      "        available for this system.\n",
      "        \n",
      "        shutil.get_terminal_size is the high-level function which should\n",
      "        normally be used, os.get_terminal_size is the low-level implementation.\n",
      "    \n",
      "    getcwd()\n",
      "        Return a unicode string representing the current working directory.\n",
      "    \n",
      "    getcwdb()\n",
      "        Return a bytes string representing the current working directory.\n",
      "    \n",
      "    getenv(key, default=None)\n",
      "        Get an environment variable, return None if it doesn't exist.\n",
      "        The optional second argument can specify an alternate default.\n",
      "        key, default and the result are str.\n",
      "    \n",
      "    getlogin()\n",
      "        Return the actual login name.\n",
      "    \n",
      "    getpid()\n",
      "        Return the current process id.\n",
      "    \n",
      "    getppid()\n",
      "        Return the parent's process id.\n",
      "        \n",
      "        If the parent process has already exited, Windows machines will still\n",
      "        return its id; others systems will return the id of the 'init' process (1).\n",
      "    \n",
      "    isatty(fd, /)\n",
      "        Return True if the fd is connected to a terminal.\n",
      "        \n",
      "        Return True if the file descriptor is an open file descriptor\n",
      "        connected to the slave end of a terminal.\n",
      "    \n",
      "    kill(pid, signal, /)\n",
      "        Kill a process with a signal.\n",
      "    \n",
      "    link(src, dst, *, src_dir_fd=None, dst_dir_fd=None, follow_symlinks=True)\n",
      "        Create a hard link to a file.\n",
      "        \n",
      "        If either src_dir_fd or dst_dir_fd is not None, it should be a file\n",
      "          descriptor open to a directory, and the respective path string (src or dst)\n",
      "          should be relative; the path will then be relative to that directory.\n",
      "        If follow_symlinks is False, and the last element of src is a symbolic\n",
      "          link, link will create a link to the symbolic link itself instead of the\n",
      "          file the link points to.\n",
      "        src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your\n",
      "          platform.  If they are unavailable, using them will raise a\n",
      "          NotImplementedError.\n",
      "    \n",
      "    listdir(path=None)\n",
      "        Return a list containing the names of the files in the directory.\n",
      "        \n",
      "        path can be specified as either str, bytes, or a path-like object.  If path is bytes,\n",
      "          the filenames returned will also be bytes; in all other circumstances\n",
      "          the filenames returned will be str.\n",
      "        If path is None, uses the path='.'.\n",
      "        On some platforms, path may also be specified as an open file descriptor;\\\n",
      "          the file descriptor must refer to a directory.\n",
      "          If this functionality is unavailable, using it raises NotImplementedError.\n",
      "        \n",
      "        The list is in arbitrary order.  It does not include the special\n",
      "        entries '.' and '..' even if they are present in the directory.\n",
      "    \n",
      "    lseek(fd, position, how, /)\n",
      "        Set the position of a file descriptor.  Return the new position.\n",
      "        \n",
      "        Return the new cursor position in number of bytes\n",
      "        relative to the beginning of the file.\n",
      "    \n",
      "    lstat(path, *, dir_fd=None)\n",
      "        Perform a stat system call on the given path, without following symbolic links.\n",
      "        \n",
      "        Like stat(), but do not follow symbolic links.\n",
      "        Equivalent to stat(path, follow_symlinks=False).\n",
      "    \n",
      "    makedirs(name, mode=511, exist_ok=False)\n",
      "        makedirs(name [, mode=0o777][, exist_ok=False])\n",
      "        \n",
      "        Super-mkdir; create a leaf directory and all intermediate ones.  Works like\n",
      "        mkdir, except that any intermediate path segment (not just the rightmost)\n",
      "        will be created if it does not exist. If the target directory already\n",
      "        exists, raise an OSError if exist_ok is False. Otherwise no exception is\n",
      "        raised.  This is recursive.\n",
      "    \n",
      "    mkdir(path, mode=511, *, dir_fd=None)\n",
      "        Create a directory.\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "          and path should be relative; path will then be relative to that directory.\n",
      "        dir_fd may not be implemented on your platform.\n",
      "          If it is unavailable, using it will raise a NotImplementedError.\n",
      "        \n",
      "        The mode argument is ignored on Windows.\n",
      "    \n",
      "    open(path, flags, mode=511, *, dir_fd=None)\n",
      "        Open a file for low level IO.  Returns a file descriptor (integer).\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "          and path should be relative; path will then be relative to that directory.\n",
      "        dir_fd may not be implemented on your platform.\n",
      "          If it is unavailable, using it will raise a NotImplementedError.\n",
      "    \n",
      "    pipe()\n",
      "        Create a pipe.\n",
      "        \n",
      "        Returns a tuple of two file descriptors:\n",
      "          (read_fd, write_fd)\n",
      "    \n",
      "    popen(cmd, mode='r', buffering=-1)\n",
      "        # Supply os.popen()\n",
      "    \n",
      "    putenv(name, value, /)\n",
      "        Change or add an environment variable.\n",
      "    \n",
      "    read(fd, length, /)\n",
      "        Read from a file descriptor.  Returns a bytes object.\n",
      "    \n",
      "    readlink(path, *, dir_fd=None)\n",
      "        Return a string representing the path to which the symbolic link points.\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "        and path should be relative; path will then be relative to that directory.\n",
      "        \n",
      "        dir_fd may not be implemented on your platform.  If it is unavailable,\n",
      "        using it will raise a NotImplementedError.\n",
      "    \n",
      "    remove(path, *, dir_fd=None)\n",
      "        Remove a file (same as unlink()).\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "          and path should be relative; path will then be relative to that directory.\n",
      "        dir_fd may not be implemented on your platform.\n",
      "          If it is unavailable, using it will raise a NotImplementedError.\n",
      "    \n",
      "    removedirs(name)\n",
      "        removedirs(name)\n",
      "        \n",
      "        Super-rmdir; remove a leaf directory and all empty intermediate\n",
      "        ones.  Works like rmdir except that, if the leaf directory is\n",
      "        successfully removed, directories corresponding to rightmost path\n",
      "        segments will be pruned away until either the whole path is\n",
      "        consumed or an error occurs.  Errors during this latter phase are\n",
      "        ignored -- they generally mean that a directory was not empty.\n",
      "    \n",
      "    rename(src, dst, *, src_dir_fd=None, dst_dir_fd=None)\n",
      "        Rename a file or directory.\n",
      "        \n",
      "        If either src_dir_fd or dst_dir_fd is not None, it should be a file\n",
      "          descriptor open to a directory, and the respective path string (src or dst)\n",
      "          should be relative; the path will then be relative to that directory.\n",
      "        src_dir_fd and dst_dir_fd, may not be implemented on your platform.\n",
      "          If they are unavailable, using them will raise a NotImplementedError.\n",
      "    \n",
      "    renames(old, new)\n",
      "        renames(old, new)\n",
      "        \n",
      "        Super-rename; create directories as necessary and delete any left\n",
      "        empty.  Works like rename, except creation of any intermediate\n",
      "        directories needed to make the new pathname good is attempted\n",
      "        first.  After the rename, directories corresponding to rightmost\n",
      "        path segments of the old name will be pruned until either the\n",
      "        whole path is consumed or a nonempty directory is found.\n",
      "        \n",
      "        Note: this function can fail with the new directory structure made\n",
      "        if you lack permissions needed to unlink the leaf directory or\n",
      "        file.\n",
      "    \n",
      "    replace(src, dst, *, src_dir_fd=None, dst_dir_fd=None)\n",
      "        Rename a file or directory, overwriting the destination.\n",
      "        \n",
      "        If either src_dir_fd or dst_dir_fd is not None, it should be a file\n",
      "          descriptor open to a directory, and the respective path string (src or dst)\n",
      "          should be relative; the path will then be relative to that directory.\n",
      "        src_dir_fd and dst_dir_fd, may not be implemented on your platform.\n",
      "          If they are unavailable, using them will raise a NotImplementedError.\n",
      "    \n",
      "    rmdir(path, *, dir_fd=None)\n",
      "        Remove a directory.\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "          and path should be relative; path will then be relative to that directory.\n",
      "        dir_fd may not be implemented on your platform.\n",
      "          If it is unavailable, using it will raise a NotImplementedError.\n",
      "    \n",
      "    scandir(path=None)\n",
      "        Return an iterator of DirEntry objects for given path.\n",
      "        \n",
      "        path can be specified as either str, bytes, or a path-like object.  If path\n",
      "        is bytes, the names of yielded DirEntry objects will also be bytes; in\n",
      "        all other circumstances they will be str.\n",
      "        \n",
      "        If path is None, uses the path='.'.\n",
      "    \n",
      "    set_handle_inheritable(handle, inheritable, /)\n",
      "        Set the inheritable flag of the specified handle.\n",
      "    \n",
      "    set_inheritable(fd, inheritable, /)\n",
      "        Set the inheritable flag of the specified file descriptor.\n",
      "    \n",
      "    spawnl(mode, file, *args)\n",
      "        spawnl(mode, file, *args) -> integer\n",
      "        \n",
      "        Execute file with arguments from args in a subprocess.\n",
      "        If mode == P_NOWAIT return the pid of the process.\n",
      "        If mode == P_WAIT return the process's exit code if it exits normally;\n",
      "        otherwise return -SIG, where SIG is the signal that killed it.\n",
      "    \n",
      "    spawnle(mode, file, *args)\n",
      "        spawnle(mode, file, *args, env) -> integer\n",
      "        \n",
      "        Execute file with arguments from args in a subprocess with the\n",
      "        supplied environment.\n",
      "        If mode == P_NOWAIT return the pid of the process.\n",
      "        If mode == P_WAIT return the process's exit code if it exits normally;\n",
      "        otherwise return -SIG, where SIG is the signal that killed it.\n",
      "    \n",
      "    spawnv(mode, path, argv, /)\n",
      "        Execute the program specified by path in a new process.\n",
      "        \n",
      "        mode\n",
      "          Mode of process creation.\n",
      "        path\n",
      "          Path of executable file.\n",
      "        argv\n",
      "          Tuple or list of strings.\n",
      "    \n",
      "    spawnve(mode, path, argv, env, /)\n",
      "        Execute the program specified by path in a new process.\n",
      "        \n",
      "        mode\n",
      "          Mode of process creation.\n",
      "        path\n",
      "          Path of executable file.\n",
      "        argv\n",
      "          Tuple or list of strings.\n",
      "        env\n",
      "          Dictionary of strings mapping to strings.\n",
      "    \n",
      "    startfile(...)\n",
      "        Start a file with its associated application.\n",
      "        \n",
      "        When \"operation\" is not specified or \"open\", this acts like\n",
      "        double-clicking the file in Explorer, or giving the file name as an\n",
      "        argument to the DOS \"start\" command: the file is opened with whatever\n",
      "        application (if any) its extension is associated.\n",
      "        When another \"operation\" is given, it specifies what should be done with\n",
      "        the file.  A typical operation is \"print\".\n",
      "        \n",
      "        startfile returns as soon as the associated application is launched.\n",
      "        There is no option to wait for the application to close, and no way\n",
      "        to retrieve the application's exit status.\n",
      "        \n",
      "        The filepath is relative to the current directory.  If you want to use\n",
      "        an absolute path, make sure the first character is not a slash (\"/\");\n",
      "        the underlying Win32 ShellExecute function doesn't work if it is.\n",
      "    \n",
      "    stat(path, *, dir_fd=None, follow_symlinks=True)\n",
      "        Perform a stat system call on the given path.\n",
      "        \n",
      "          path\n",
      "            Path to be examined; can be string, bytes, a path-like object or\n",
      "            open-file-descriptor int.\n",
      "          dir_fd\n",
      "            If not None, it should be a file descriptor open to a directory,\n",
      "            and path should be a relative string; path will then be relative to\n",
      "            that directory.\n",
      "          follow_symlinks\n",
      "            If False, and the last element of the path is a symbolic link,\n",
      "            stat will examine the symbolic link itself instead of the file\n",
      "            the link points to.\n",
      "        \n",
      "        dir_fd and follow_symlinks may not be implemented\n",
      "          on your platform.  If they are unavailable, using them will raise a\n",
      "          NotImplementedError.\n",
      "        \n",
      "        It's an error to use dir_fd or follow_symlinks when specifying path as\n",
      "          an open file descriptor.\n",
      "    \n",
      "    strerror(code, /)\n",
      "        Translate an error code to a message string.\n",
      "    \n",
      "    symlink(src, dst, target_is_directory=False, *, dir_fd=None)\n",
      "        Create a symbolic link pointing to src named dst.\n",
      "        \n",
      "        target_is_directory is required on Windows if the target is to be\n",
      "          interpreted as a directory.  (On Windows, symlink requires\n",
      "          Windows 6.0 or greater, and raises a NotImplementedError otherwise.)\n",
      "          target_is_directory is ignored on non-Windows platforms.\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "          and path should be relative; path will then be relative to that directory.\n",
      "        dir_fd may not be implemented on your platform.\n",
      "          If it is unavailable, using it will raise a NotImplementedError.\n",
      "    \n",
      "    system(command)\n",
      "        Execute the command in a subshell.\n",
      "    \n",
      "    times()\n",
      "        Return a collection containing process timing information.\n",
      "        \n",
      "        The object returned behaves like a named tuple with these fields:\n",
      "          (utime, stime, cutime, cstime, elapsed_time)\n",
      "        All fields are floating point numbers.\n",
      "    \n",
      "    truncate(path, length)\n",
      "        Truncate a file, specified by path, to a specific length.\n",
      "        \n",
      "        On some platforms, path may also be specified as an open file descriptor.\n",
      "          If this functionality is unavailable, using it raises an exception.\n",
      "    \n",
      "    umask(mask, /)\n",
      "        Set the current numeric umask and return the previous umask.\n",
      "    \n",
      "    unlink(path, *, dir_fd=None)\n",
      "        Remove a file (same as remove()).\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "          and path should be relative; path will then be relative to that directory.\n",
      "        dir_fd may not be implemented on your platform.\n",
      "          If it is unavailable, using it will raise a NotImplementedError.\n",
      "    \n",
      "    urandom(size, /)\n",
      "        Return a bytes object containing random bytes suitable for cryptographic use.\n",
      "    \n",
      "    utime(...)\n",
      "        Set the access and modified time of path.\n",
      "        \n",
      "        path may always be specified as a string.\n",
      "        On some platforms, path may also be specified as an open file descriptor.\n",
      "          If this functionality is unavailable, using it raises an exception.\n",
      "        \n",
      "        If times is not None, it must be a tuple (atime, mtime);\n",
      "            atime and mtime should be expressed as float seconds since the epoch.\n",
      "        If ns is specified, it must be a tuple (atime_ns, mtime_ns);\n",
      "            atime_ns and mtime_ns should be expressed as integer nanoseconds\n",
      "            since the epoch.\n",
      "        If times is None and ns is unspecified, utime uses the current time.\n",
      "        Specifying tuples for both times and ns is an error.\n",
      "        \n",
      "        If dir_fd is not None, it should be a file descriptor open to a directory,\n",
      "          and path should be relative; path will then be relative to that directory.\n",
      "        If follow_symlinks is False, and the last element of the path is a symbolic\n",
      "          link, utime will modify the symbolic link itself instead of the file the\n",
      "          link points to.\n",
      "        It is an error to use dir_fd or follow_symlinks when specifying path\n",
      "          as an open file descriptor.\n",
      "        dir_fd and follow_symlinks may not be available on your platform.\n",
      "          If they are unavailable, using them will raise a NotImplementedError.\n",
      "    \n",
      "    waitpid(pid, options, /)\n",
      "        Wait for completion of a given process.\n",
      "        \n",
      "        Returns a tuple of information regarding the process:\n",
      "            (pid, status << 8)\n",
      "        \n",
      "        The options argument is ignored on Windows.\n",
      "    \n",
      "    walk(top, topdown=True, onerror=None, followlinks=False)\n",
      "        Directory tree generator.\n",
      "        \n",
      "        For each directory in the directory tree rooted at top (including top\n",
      "        itself, but excluding '.' and '..'), yields a 3-tuple\n",
      "        \n",
      "            dirpath, dirnames, filenames\n",
      "        \n",
      "        dirpath is a string, the path to the directory.  dirnames is a list of\n",
      "        the names of the subdirectories in dirpath (excluding '.' and '..').\n",
      "        filenames is a list of the names of the non-directory files in dirpath.\n",
      "        Note that the names in the lists are just names, with no path components.\n",
      "        To get a full path (which begins with top) to a file or directory in\n",
      "        dirpath, do os.path.join(dirpath, name).\n",
      "        \n",
      "        If optional arg 'topdown' is true or not specified, the triple for a\n",
      "        directory is generated before the triples for any of its subdirectories\n",
      "        (directories are generated top down).  If topdown is false, the triple\n",
      "        for a directory is generated after the triples for all of its\n",
      "        subdirectories (directories are generated bottom up).\n",
      "        \n",
      "        When topdown is true, the caller can modify the dirnames list in-place\n",
      "        (e.g., via del or slice assignment), and walk will only recurse into the\n",
      "        subdirectories whose names remain in dirnames; this can be used to prune the\n",
      "        search, or to impose a specific order of visiting.  Modifying dirnames when\n",
      "        topdown is false has no effect on the behavior of os.walk(), since the\n",
      "        directories in dirnames have already been generated by the time dirnames\n",
      "        itself is generated. No matter the value of topdown, the list of\n",
      "        subdirectories is retrieved before the tuples for the directory and its\n",
      "        subdirectories are generated.\n",
      "        \n",
      "        By default errors from the os.scandir() call are ignored.  If\n",
      "        optional arg 'onerror' is specified, it should be a function; it\n",
      "        will be called with one argument, an OSError instance.  It can\n",
      "        report the error to continue with the walk, or raise the exception\n",
      "        to abort the walk.  Note that the filename is available as the\n",
      "        filename attribute of the exception object.\n",
      "        \n",
      "        By default, os.walk does not follow symbolic links to subdirectories on\n",
      "        systems that support them.  In order to get this functionality, set the\n",
      "        optional argument 'followlinks' to true.\n",
      "        \n",
      "        Caution:  if you pass a relative pathname for top, don't change the\n",
      "        current working directory between resumptions of walk.  walk never\n",
      "        changes the current directory, and assumes that the client doesn't\n",
      "        either.\n",
      "        \n",
      "        Example:\n",
      "        \n",
      "        import os\n",
      "        from os.path import join, getsize\n",
      "        for root, dirs, files in os.walk('python/Lib/email'):\n",
      "            print(root, \"consumes\", end=\"\")\n",
      "            print(sum(getsize(join(root, name)) for name in files), end=\"\")\n",
      "            print(\"bytes in\", len(files), \"non-directory files\")\n",
      "            if 'CVS' in dirs:\n",
      "                dirs.remove('CVS')  # don't visit CVS directories\n",
      "    \n",
      "    write(fd, data, /)\n",
      "        Write a bytes object to a file descriptor.\n",
      "\n",
      "DATA\n",
      "    F_OK = 0\n",
      "    O_APPEND = 8\n",
      "    O_BINARY = 32768\n",
      "    O_CREAT = 256\n",
      "    O_EXCL = 1024\n",
      "    O_NOINHERIT = 128\n",
      "    O_RANDOM = 16\n",
      "    O_RDONLY = 0\n",
      "    O_RDWR = 2\n",
      "    O_SEQUENTIAL = 32\n",
      "    O_SHORT_LIVED = 4096\n",
      "    O_TEMPORARY = 64\n",
      "    O_TEXT = 16384\n",
      "    O_TRUNC = 512\n",
      "    O_WRONLY = 1\n",
      "    P_DETACH = 4\n",
      "    P_NOWAIT = 1\n",
      "    P_NOWAITO = 3\n",
      "    P_OVERLAY = 2\n",
      "    P_WAIT = 0\n",
      "    R_OK = 4\n",
      "    SEEK_CUR = 1\n",
      "    SEEK_END = 2\n",
      "    SEEK_SET = 0\n",
      "    TMP_MAX = 2147483647\n",
      "    W_OK = 2\n",
      "    X_OK = 1\n",
      "    __all__ = ['altsep', 'curdir', 'pardir', 'sep', 'pathsep', 'linesep', ...\n",
      "    altsep = '/'\n",
      "    curdir = '.'\n",
      "    defpath = r'.;C:\\bin'\n",
      "    devnull = 'nul'\n",
      "    environ = environ({'ALLUSERSPROFILE': 'C:\\\\ProgramData', '...END': 'mo...\n",
      "    extsep = '.'\n",
      "    linesep = '\\r\\n'\n",
      "    name = 'nt'\n",
      "    pardir = '..'\n",
      "    pathsep = ';'\n",
      "    sep = r'\\'\n",
      "    supports_bytes_environ = False\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\os.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(os)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8c032750",
   "metadata": {},
   "source": [
    "#### 2.glob 文件通配符\n",
    "* 提供了一个函数用于从目录通配符搜索中生成文件列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "285589a3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import glob\n",
    "glob.glob('*.py')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1fc38766",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on module glob:\n",
      "\n",
      "NAME\n",
      "    glob - Filename globbing utility.\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/glob\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "FUNCTIONS\n",
      "    escape(pathname)\n",
      "        Escape all special characters.\n",
      "    \n",
      "    glob(pathname, *, recursive=False)\n",
      "        Return a list of paths matching a pathname pattern.\n",
      "        \n",
      "        The pattern may contain simple shell-style wildcards a la\n",
      "        fnmatch. However, unlike fnmatch, filenames starting with a\n",
      "        dot are special cases that are not matched by '*' and '?'\n",
      "        patterns.\n",
      "        \n",
      "        If recursive is true, the pattern '**' will match any files and\n",
      "        zero or more directories and subdirectories.\n",
      "    \n",
      "    iglob(pathname, *, recursive=False)\n",
      "        Return an iterator which yields the paths matching a pathname pattern.\n",
      "        \n",
      "        The pattern may contain simple shell-style wildcards a la\n",
      "        fnmatch. However, unlike fnmatch, filenames starting with a\n",
      "        dot are special cases that are not matched by '*' and '?'\n",
      "        patterns.\n",
      "        \n",
      "        If recursive is true, the pattern '**' will match any files and\n",
      "        zero or more directories and subdirectories.\n",
      "\n",
      "DATA\n",
      "    __all__ = ['glob', 'iglob', 'escape']\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\glob.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(glob)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b99b54a",
   "metadata": {},
   "source": [
    "#### 3. sys 命令行参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "2024b88e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\ipykernel_launcher.py', '-f', 'C:\\\\Users\\\\LZ\\\\AppData\\\\Roaming\\\\jupyter\\\\runtime\\\\kernel-3efd2982-3fd8-458b-85ad-3a4538385477.json']\n"
     ]
    }
   ],
   "source": [
    "import sys\n",
    "print(sys.argv)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "abbae346",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in module sys:\n",
      "\n",
      "NAME\n",
      "    sys\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/sys\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "DESCRIPTION\n",
      "    This module provides access to some objects used or maintained by the\n",
      "    interpreter and to functions that interact strongly with the interpreter.\n",
      "    \n",
      "    Dynamic objects:\n",
      "    \n",
      "    argv -- command line arguments; argv[0] is the script pathname if known\n",
      "    path -- module search path; path[0] is the script directory, else ''\n",
      "    modules -- dictionary of loaded modules\n",
      "    \n",
      "    displayhook -- called to show results in an interactive session\n",
      "    excepthook -- called to handle any uncaught exception other than SystemExit\n",
      "      To customize printing in an interactive session or to install a custom\n",
      "      top-level exception handler, assign other functions to replace these.\n",
      "    \n",
      "    stdin -- standard input file object; used by input()\n",
      "    stdout -- standard output file object; used by print()\n",
      "    stderr -- standard error object; used for error messages\n",
      "      By assigning other file objects (or objects that behave like files)\n",
      "      to these, it is possible to redirect all of the interpreter's I/O.\n",
      "    \n",
      "    last_type -- type of last uncaught exception\n",
      "    last_value -- value of last uncaught exception\n",
      "    last_traceback -- traceback of last uncaught exception\n",
      "      These three are only available in an interactive session after a\n",
      "      traceback has been printed.\n",
      "    \n",
      "    Static objects:\n",
      "    \n",
      "    builtin_module_names -- tuple of module names built into this interpreter\n",
      "    copyright -- copyright notice pertaining to this interpreter\n",
      "    exec_prefix -- prefix used to find the machine-specific Python library\n",
      "    executable -- absolute path of the executable binary of the Python interpreter\n",
      "    float_info -- a named tuple with information about the float implementation.\n",
      "    float_repr_style -- string indicating the style of repr() output for floats\n",
      "    hash_info -- a named tuple with information about the hash algorithm.\n",
      "    hexversion -- version information encoded as a single integer\n",
      "    implementation -- Python implementation information.\n",
      "    int_info -- a named tuple with information about the int implementation.\n",
      "    maxsize -- the largest supported length of containers.\n",
      "    maxunicode -- the value of the largest Unicode code point\n",
      "    platform -- platform identifier\n",
      "    prefix -- prefix used to find the Python library\n",
      "    thread_info -- a named tuple with information about the thread implementation.\n",
      "    version -- the version of this interpreter as a string\n",
      "    version_info -- version information as a named tuple\n",
      "    dllhandle -- [Windows only] integer handle of the Python DLL\n",
      "    winver -- [Windows only] version number of the Python DLL\n",
      "    _enablelegacywindowsfsencoding -- [Windows only]\n",
      "    __stdin__ -- the original stdin; don't touch!\n",
      "    __stdout__ -- the original stdout; don't touch!\n",
      "    __stderr__ -- the original stderr; don't touch!\n",
      "    __displayhook__ -- the original displayhook; don't touch!\n",
      "    __excepthook__ -- the original excepthook; don't touch!\n",
      "    \n",
      "    Functions:\n",
      "    \n",
      "    displayhook() -- print an object to the screen, and save it in builtins._\n",
      "    excepthook() -- print an exception and its traceback to sys.stderr\n",
      "    exc_info() -- return thread-safe information about the current exception\n",
      "    exit() -- exit the interpreter by raising SystemExit\n",
      "    getdlopenflags() -- returns flags to be used for dlopen() calls\n",
      "    getprofile() -- get the global profiling function\n",
      "    getrefcount() -- return the reference count for an object (plus one :-)\n",
      "    getrecursionlimit() -- return the max recursion depth for the interpreter\n",
      "    getsizeof() -- return the size of an object in bytes\n",
      "    gettrace() -- get the global debug tracing function\n",
      "    setcheckinterval() -- control how often the interpreter checks for events\n",
      "    setdlopenflags() -- set the flags to be used for dlopen() calls\n",
      "    setprofile() -- set the global profiling function\n",
      "    setrecursionlimit() -- set the max recursion depth for the interpreter\n",
      "    settrace() -- set the global debug tracing function\n",
      "\n",
      "FUNCTIONS\n",
      "    __breakpointhook__ = breakpointhook(...)\n",
      "        breakpointhook(*args, **kws)\n",
      "        \n",
      "        This hook function is called by built-in breakpoint().\n",
      "    \n",
      "    __displayhook__ = displayhook(object, /)\n",
      "        Print an object to sys.stdout and also save it in builtins._\n",
      "    \n",
      "    __excepthook__ = excepthook(exctype, value, traceback, /)\n",
      "        Handle an exception by displaying it with a traceback on sys.stderr.\n",
      "    \n",
      "    __unraisablehook__ = unraisablehook(unraisable, /)\n",
      "        Handle an unraisable exception.\n",
      "        \n",
      "        The unraisable argument has the following attributes:\n",
      "        \n",
      "        * exc_type: Exception type.\n",
      "        * exc_value: Exception value, can be None.\n",
      "        * exc_traceback: Exception traceback, can be None.\n",
      "        * err_msg: Error message, can be None.\n",
      "        * object: Object causing the exception, can be None.\n",
      "    \n",
      "    addaudithook(hook)\n",
      "        Adds a new audit hook callback.\n",
      "    \n",
      "    audit(...)\n",
      "        audit(event, *args)\n",
      "        \n",
      "        Passes the event to any audit hooks that are attached.\n",
      "    \n",
      "    breakpointhook(...)\n",
      "        breakpointhook(*args, **kws)\n",
      "        \n",
      "        This hook function is called by built-in breakpoint().\n",
      "    \n",
      "    call_tracing(func, args, /)\n",
      "        Call func(*args), while tracing is enabled.\n",
      "        \n",
      "        The tracing state is saved, and restored afterwards.  This is intended\n",
      "        to be called from a debugger from a checkpoint, to recursively debug\n",
      "        some other code.\n",
      "    \n",
      "    callstats()\n",
      "        Return a tuple of function call statistics.\n",
      "        \n",
      "        A tuple is returned only if CALL_PROFILE was defined when Python was\n",
      "        built.  Otherwise, this returns None.\n",
      "        \n",
      "        When enabled, this function returns detailed, implementation-specific\n",
      "        details about the number of function calls executed. The return value\n",
      "        is a 11-tuple where the entries in the tuple are counts of:\n",
      "        0. all function calls\n",
      "        1. calls to PyFunction_Type objects\n",
      "        2. PyFunction calls that do not create an argument tuple\n",
      "        3. PyFunction calls that do not create an argument tuple\n",
      "           and bypass PyEval_EvalCodeEx()\n",
      "        4. PyMethod calls\n",
      "        5. PyMethod calls on bound methods\n",
      "        6. PyType calls\n",
      "        7. PyCFunction calls\n",
      "        8. generator calls\n",
      "        9. All other calls\n",
      "        10. Number of stack pops performed by call_function()\n",
      "    \n",
      "    exc_info()\n",
      "        Return current exception information: (type, value, traceback).\n",
      "        \n",
      "        Return information about the most recent exception caught by an except\n",
      "        clause in the current stack frame or in an older stack frame.\n",
      "    \n",
      "    exit(status=None, /)\n",
      "        Exit the interpreter by raising SystemExit(status).\n",
      "        \n",
      "        If the status is omitted or None, it defaults to zero (i.e., success).\n",
      "        If the status is an integer, it will be used as the system exit status.\n",
      "        If it is another kind of object, it will be printed and the system\n",
      "        exit status will be one (i.e., failure).\n",
      "    \n",
      "    get_asyncgen_hooks()\n",
      "        Return the installed asynchronous generators hooks.\n",
      "        \n",
      "        This returns a namedtuple of the form (firstiter, finalizer).\n",
      "    \n",
      "    get_coroutine_origin_tracking_depth()\n",
      "        Check status of origin tracking for coroutine objects in this thread.\n",
      "    \n",
      "    getallocatedblocks()\n",
      "        Return the number of memory blocks currently allocated.\n",
      "    \n",
      "    getcheckinterval()\n",
      "        Return the current check interval; see sys.setcheckinterval().\n",
      "    \n",
      "    getdefaultencoding()\n",
      "        Return the current default encoding used by the Unicode implementation.\n",
      "    \n",
      "    getfilesystemencodeerrors()\n",
      "        Return the error mode used Unicode to OS filename conversion.\n",
      "    \n",
      "    getfilesystemencoding()\n",
      "        Return the encoding used to convert Unicode filenames to OS filenames.\n",
      "    \n",
      "    getprofile()\n",
      "        Return the profiling function set with sys.setprofile.\n",
      "        \n",
      "        See the profiler chapter in the library manual.\n",
      "    \n",
      "    getrecursionlimit()\n",
      "        Return the current value of the recursion limit.\n",
      "        \n",
      "        The recursion limit is the maximum depth of the Python interpreter\n",
      "        stack.  This limit prevents infinite recursion from causing an overflow\n",
      "        of the C stack and crashing Python.\n",
      "    \n",
      "    getrefcount(object, /)\n",
      "        Return the reference count of object.\n",
      "        \n",
      "        The count returned is generally one higher than you might expect,\n",
      "        because it includes the (temporary) reference as an argument to\n",
      "        getrefcount().\n",
      "    \n",
      "    getsizeof(...)\n",
      "        getsizeof(object [, default]) -> int\n",
      "        \n",
      "        Return the size of object in bytes.\n",
      "    \n",
      "    getswitchinterval()\n",
      "        Return the current thread switch interval; see sys.setswitchinterval().\n",
      "    \n",
      "    gettrace()\n",
      "        Return the global debug tracing function set with sys.settrace.\n",
      "        \n",
      "        See the debugger chapter in the library manual.\n",
      "    \n",
      "    getwindowsversion()\n",
      "        Return info about the running version of Windows as a named tuple.\n",
      "        \n",
      "        The members are named: major, minor, build, platform, service_pack,\n",
      "        service_pack_major, service_pack_minor, suite_mask, product_type and\n",
      "        platform_version. For backward compatibility, only the first 5 items\n",
      "        are available by indexing. All elements are numbers, except\n",
      "        service_pack and platform_type which are strings, and platform_version\n",
      "        which is a 3-tuple. Platform is always 2. Product_type may be 1 for a\n",
      "        workstation, 2 for a domain controller, 3 for a server.\n",
      "        Platform_version is a 3-tuple containing a version number that is\n",
      "        intended for identifying the OS rather than feature detection.\n",
      "    \n",
      "    intern(string, /)\n",
      "        ``Intern'' the given string.\n",
      "        \n",
      "        This enters the string in the (global) table of interned strings whose\n",
      "        purpose is to speed up dictionary lookups. Return the string itself or\n",
      "        the previously interned string object with the same value.\n",
      "    \n",
      "    is_finalizing()\n",
      "        Return True if Python is exiting.\n",
      "    \n",
      "    set_asyncgen_hooks(...)\n",
      "        set_asyncgen_hooks(* [, firstiter] [, finalizer])\n",
      "        \n",
      "        Set a finalizer for async generators objects.\n",
      "    \n",
      "    set_coroutine_origin_tracking_depth(depth)\n",
      "        Enable or disable origin tracking for coroutine objects in this thread.\n",
      "        \n",
      "        Coroutine objects will track 'depth' frames of traceback information\n",
      "        about where they came from, available in their cr_origin attribute.\n",
      "        \n",
      "        Set a depth of 0 to disable.\n",
      "    \n",
      "    setcheckinterval(n, /)\n",
      "        Set the async event check interval to n instructions.\n",
      "        \n",
      "        This tells the Python interpreter to check for asynchronous events\n",
      "        every n instructions.\n",
      "        \n",
      "        This also affects how often thread switches occur.\n",
      "    \n",
      "    setprofile(...)\n",
      "        setprofile(function)\n",
      "        \n",
      "        Set the profiling function.  It will be called on each function call\n",
      "        and return.  See the profiler chapter in the library manual.\n",
      "    \n",
      "    setrecursionlimit(limit, /)\n",
      "        Set the maximum depth of the Python interpreter stack to n.\n",
      "        \n",
      "        This limit prevents infinite recursion from causing an overflow of the C\n",
      "        stack and crashing Python.  The highest possible limit is platform-\n",
      "        dependent.\n",
      "    \n",
      "    setswitchinterval(interval, /)\n",
      "        Set the ideal thread switching delay inside the Python interpreter.\n",
      "        \n",
      "        The actual frequency of switching threads can be lower if the\n",
      "        interpreter executes long sequences of uninterruptible code\n",
      "        (this is implementation-specific and workload-dependent).\n",
      "        \n",
      "        The parameter must represent the desired switching delay in seconds\n",
      "        A typical value is 0.005 (5 milliseconds).\n",
      "    \n",
      "    settrace(...)\n",
      "        settrace(function)\n",
      "        \n",
      "        Set the global debug tracing function.  It will be called on each\n",
      "        function call.  See the debugger chapter in the library manual.\n",
      "    \n",
      "    unraisablehook(unraisable, /)\n",
      "        Handle an unraisable exception.\n",
      "        \n",
      "        The unraisable argument has the following attributes:\n",
      "        \n",
      "        * exc_type: Exception type.\n",
      "        * exc_value: Exception value, can be None.\n",
      "        * exc_traceback: Exception traceback, can be None.\n",
      "        * err_msg: Error message, can be None.\n",
      "        * object: Object causing the exception, can be None.\n",
      "\n",
      "DATA\n",
      "    __stderr__ = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf...\n",
      "    __stdin__ = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='gbk'>\n",
      "    __stdout__ = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf...\n",
      "    api_version = 1013\n",
      "    argv = [r'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launche...\n",
      "    base_exec_prefix = r'C:\\ProgramData\\Anaconda3'\n",
      "    base_prefix = r'C:\\ProgramData\\Anaconda3'\n",
      "    builtin_module_names = ('_abc', '_ast', '_bisect', '_blake2', '_codecs...\n",
      "    byteorder = 'little'\n",
      "    copyright = 'Copyright (c) 2001-2021 Python Software Foundati...ematis...\n",
      "    displayhook = <ipykernel.displayhook.ZMQShellDisplayHook object>\n",
      "    dllhandle = 140724329840640\n",
      "    dont_write_bytecode = False\n",
      "    exec_prefix = r'C:\\ProgramData\\Anaconda3'\n",
      "    executable = r'C:\\ProgramData\\Anaconda3\\python.exe'\n",
      "    flags = sys.flags(debug=0, inspect=0, interactive=0, opt...ation=1, is...\n",
      "    float_info = sys.float_info(max=1.7976931348623157e+308, max_...epsilo...\n",
      "    float_repr_style = 'short'\n",
      "    hash_info = sys.hash_info(width=64, modulus=2305843009213693...iphash2...\n",
      "    hexversion = 50858224\n",
      "    implementation = namespace(cache_tag='cpython-38', hexversion=508...in...\n",
      "    int_info = sys.int_info(bits_per_digit=30, sizeof_digit=4)\n",
      "    maxsize = 9223372036854775807\n",
      "    maxunicode = 1114111\n",
      "    meta_path = [<class '_frozen_importlib.BuiltinImporter'>, <class '_fro...\n",
      "    modules = {'IPython': <module 'IPython' from 'C:\\\\ProgramData\\\\Anacond...\n",
      "    path = [r'C:\\Users\\LZ\\Python课程\\练习', r'C:\\ProgramData\\Anaconda3\\python3...\n",
      "    path_hooks = [<class 'zipimport.zipimporter'>, <function FileFinder.pa...\n",
      "    path_importer_cache = {r'C:\\ProgramData\\Anaconda3': FileFinder('C:\\\\Pr...\n",
      "    platform = 'win32'\n",
      "    prefix = r'C:\\ProgramData\\Anaconda3'\n",
      "    ps1 = 'In : '\n",
      "    ps2 = '...: '\n",
      "    ps3 = 'Out: '\n",
      "    pycache_prefix = None\n",
      "    stderr = <ipykernel.iostream.OutStream object>\n",
      "    stdin = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='gbk'>\n",
      "    stdout = <ipykernel.iostream.OutStream object>\n",
      "    thread_info = sys.thread_info(name='nt', lock=None, version=None)\n",
      "    version = '3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (...\n",
      "    version_info = sys.version_info(major=3, minor=8, micro=8, releaseleve...\n",
      "    warnoptions = []\n",
      "    winver = '3.8'\n",
      "\n",
      "FILE\n",
      "    (built-in)\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(sys)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "67076b4a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'win32'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys.platform"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "02504174",
   "metadata": {},
   "source": [
    "#### 4. re 字符串正则匹配\n",
    "* 为高级字符串处理提供了正则表达式工具"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "a78cc4ed",
   "metadata": {},
   "outputs": [],
   "source": [
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "c6aaa81f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on module re:\n",
      "\n",
      "NAME\n",
      "    re - Support for regular expressions (RE).\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/re\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "DESCRIPTION\n",
      "    This module provides regular expression matching operations similar to\n",
      "    those found in Perl.  It supports both 8-bit and Unicode strings; both\n",
      "    the pattern and the strings being processed can contain null bytes and\n",
      "    characters outside the US ASCII range.\n",
      "    \n",
      "    Regular expressions can contain both special and ordinary characters.\n",
      "    Most ordinary characters, like \"A\", \"a\", or \"0\", are the simplest\n",
      "    regular expressions; they simply match themselves.  You can\n",
      "    concatenate ordinary characters, so last matches the string 'last'.\n",
      "    \n",
      "    The special characters are:\n",
      "        \".\"      Matches any character except a newline.\n",
      "        \"^\"      Matches the start of the string.\n",
      "        \"$\"      Matches the end of the string or just before the newline at\n",
      "                 the end of the string.\n",
      "        \"*\"      Matches 0 or more (greedy) repetitions of the preceding RE.\n",
      "                 Greedy means that it will match as many repetitions as possible.\n",
      "        \"+\"      Matches 1 or more (greedy) repetitions of the preceding RE.\n",
      "        \"?\"      Matches 0 or 1 (greedy) of the preceding RE.\n",
      "        *?,+?,?? Non-greedy versions of the previous three special characters.\n",
      "        {m,n}    Matches from m to n repetitions of the preceding RE.\n",
      "        {m,n}?   Non-greedy version of the above.\n",
      "        \"\\\\\"     Either escapes special characters or signals a special sequence.\n",
      "        []       Indicates a set of characters.\n",
      "                 A \"^\" as the first character indicates a complementing set.\n",
      "        \"|\"      A|B, creates an RE that will match either A or B.\n",
      "        (...)    Matches the RE inside the parentheses.\n",
      "                 The contents can be retrieved or matched later in the string.\n",
      "        (?aiLmsux) The letters set the corresponding flags defined below.\n",
      "        (?:...)  Non-grouping version of regular parentheses.\n",
      "        (?P<name>...) The substring matched by the group is accessible by name.\n",
      "        (?P=name)     Matches the text matched earlier by the group named name.\n",
      "        (?#...)  A comment; ignored.\n",
      "        (?=...)  Matches if ... matches next, but doesn't consume the string.\n",
      "        (?!...)  Matches if ... doesn't match next.\n",
      "        (?<=...) Matches if preceded by ... (must be fixed length).\n",
      "        (?<!...) Matches if not preceded by ... (must be fixed length).\n",
      "        (?(id/name)yes|no) Matches yes pattern if the group with id/name matched,\n",
      "                           the (optional) no pattern otherwise.\n",
      "    \n",
      "    The special sequences consist of \"\\\\\" and a character from the list\n",
      "    below.  If the ordinary character is not on the list, then the\n",
      "    resulting RE will match the second character.\n",
      "        \\number  Matches the contents of the group of the same number.\n",
      "        \\A       Matches only at the start of the string.\n",
      "        \\Z       Matches only at the end of the string.\n",
      "        \\b       Matches the empty string, but only at the start or end of a word.\n",
      "        \\B       Matches the empty string, but not at the start or end of a word.\n",
      "        \\d       Matches any decimal digit; equivalent to the set [0-9] in\n",
      "                 bytes patterns or string patterns with the ASCII flag.\n",
      "                 In string patterns without the ASCII flag, it will match the whole\n",
      "                 range of Unicode digits.\n",
      "        \\D       Matches any non-digit character; equivalent to [^\\d].\n",
      "        \\s       Matches any whitespace character; equivalent to [ \\t\\n\\r\\f\\v] in\n",
      "                 bytes patterns or string patterns with the ASCII flag.\n",
      "                 In string patterns without the ASCII flag, it will match the whole\n",
      "                 range of Unicode whitespace characters.\n",
      "        \\S       Matches any non-whitespace character; equivalent to [^\\s].\n",
      "        \\w       Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]\n",
      "                 in bytes patterns or string patterns with the ASCII flag.\n",
      "                 In string patterns without the ASCII flag, it will match the\n",
      "                 range of Unicode alphanumeric characters (letters plus digits\n",
      "                 plus underscore).\n",
      "                 With LOCALE, it will match the set [0-9_] plus characters defined\n",
      "                 as letters for the current locale.\n",
      "        \\W       Matches the complement of \\w.\n",
      "        \\\\       Matches a literal backslash.\n",
      "    \n",
      "    This module exports the following functions:\n",
      "        match     Match a regular expression pattern to the beginning of a string.\n",
      "        fullmatch Match a regular expression pattern to all of a string.\n",
      "        search    Search a string for the presence of a pattern.\n",
      "        sub       Substitute occurrences of a pattern found in a string.\n",
      "        subn      Same as sub, but also return the number of substitutions made.\n",
      "        split     Split a string by the occurrences of a pattern.\n",
      "        findall   Find all occurrences of a pattern in a string.\n",
      "        finditer  Return an iterator yielding a Match object for each match.\n",
      "        compile   Compile a pattern into a Pattern object.\n",
      "        purge     Clear the regular expression cache.\n",
      "        escape    Backslash all non-alphanumerics in a string.\n",
      "    \n",
      "    Each function other than purge and escape can take an optional 'flags' argument\n",
      "    consisting of one or more of the following module constants, joined by \"|\".\n",
      "    A, L, and U are mutually exclusive.\n",
      "        A  ASCII       For string patterns, make \\w, \\W, \\b, \\B, \\d, \\D\n",
      "                       match the corresponding ASCII character categories\n",
      "                       (rather than the whole Unicode categories, which is the\n",
      "                       default).\n",
      "                       For bytes patterns, this flag is the only available\n",
      "                       behaviour and needn't be specified.\n",
      "        I  IGNORECASE  Perform case-insensitive matching.\n",
      "        L  LOCALE      Make \\w, \\W, \\b, \\B, dependent on the current locale.\n",
      "        M  MULTILINE   \"^\" matches the beginning of lines (after a newline)\n",
      "                       as well as the string.\n",
      "                       \"$\" matches the end of lines (before a newline) as well\n",
      "                       as the end of the string.\n",
      "        S  DOTALL      \".\" matches any character at all, including the newline.\n",
      "        X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.\n",
      "        U  UNICODE     For compatibility only. Ignored for string patterns (it\n",
      "                       is the default), and forbidden for bytes patterns.\n",
      "    \n",
      "    This module also defines an exception 'error'.\n",
      "\n",
      "CLASSES\n",
      "    builtins.Exception(builtins.BaseException)\n",
      "        error\n",
      "    builtins.object\n",
      "        Match\n",
      "        Pattern\n",
      "    \n",
      "    class Match(builtins.object)\n",
      "     |  The result of re.match() and re.search().\n",
      "     |  Match objects always have a boolean value of True.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __copy__(self, /)\n",
      "     |  \n",
      "     |  __deepcopy__(self, memo, /)\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  end(self, group=0, /)\n",
      "     |      Return index of the end of the substring matched by group.\n",
      "     |  \n",
      "     |  expand(self, /, template)\n",
      "     |      Return the string obtained by doing backslash substitution on the string template, as done by the sub() method.\n",
      "     |  \n",
      "     |  group(...)\n",
      "     |      group([group1, ...]) -> str or tuple.\n",
      "     |      Return subgroup(s) of the match by indices or names.\n",
      "     |      For 0 returns the entire match.\n",
      "     |  \n",
      "     |  groupdict(self, /, default=None)\n",
      "     |      Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.\n",
      "     |      \n",
      "     |      default\n",
      "     |        Is used for groups that did not participate in the match.\n",
      "     |  \n",
      "     |  groups(self, /, default=None)\n",
      "     |      Return a tuple containing all the subgroups of the match, from 1.\n",
      "     |      \n",
      "     |      default\n",
      "     |        Is used for groups that did not participate in the match.\n",
      "     |  \n",
      "     |  span(self, group=0, /)\n",
      "     |      For match object m, return the 2-tuple (m.start(group), m.end(group)).\n",
      "     |  \n",
      "     |  start(self, group=0, /)\n",
      "     |      Return index of the start of the substring matched by group.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  endpos\n",
      "     |      The index into the string beyond which the RE engine will not go.\n",
      "     |  \n",
      "     |  lastgroup\n",
      "     |      The name of the last matched capturing group.\n",
      "     |  \n",
      "     |  lastindex\n",
      "     |      The integer index of the last matched capturing group.\n",
      "     |  \n",
      "     |  pos\n",
      "     |      The index into the string at which the RE engine started looking for a match.\n",
      "     |  \n",
      "     |  re\n",
      "     |      The regular expression object.\n",
      "     |  \n",
      "     |  regs\n",
      "     |  \n",
      "     |  string\n",
      "     |      The string passed to match() or search().\n",
      "    \n",
      "    class Pattern(builtins.object)\n",
      "     |  Compiled regular expression object.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __copy__(self, /)\n",
      "     |  \n",
      "     |  __deepcopy__(self, memo, /)\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  findall(self, /, string, pos=0, endpos=9223372036854775807)\n",
      "     |      Return a list of all non-overlapping matches of pattern in string.\n",
      "     |  \n",
      "     |  finditer(self, /, string, pos=0, endpos=9223372036854775807)\n",
      "     |      Return an iterator over all non-overlapping matches for the RE pattern in string.\n",
      "     |      \n",
      "     |      For each match, the iterator returns a match object.\n",
      "     |  \n",
      "     |  fullmatch(self, /, string, pos=0, endpos=9223372036854775807)\n",
      "     |      Matches against all of the string.\n",
      "     |  \n",
      "     |  match(self, /, string, pos=0, endpos=9223372036854775807)\n",
      "     |      Matches zero or more characters at the beginning of the string.\n",
      "     |  \n",
      "     |  scanner(self, /, string, pos=0, endpos=9223372036854775807)\n",
      "     |  \n",
      "     |  search(self, /, string, pos=0, endpos=9223372036854775807)\n",
      "     |      Scan through string looking for a match, and return a corresponding match object instance.\n",
      "     |      \n",
      "     |      Return None if no position in the string matches.\n",
      "     |  \n",
      "     |  split(self, /, string, maxsplit=0)\n",
      "     |      Split string by the occurrences of pattern.\n",
      "     |  \n",
      "     |  sub(self, /, repl, string, count=0)\n",
      "     |      Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.\n",
      "     |  \n",
      "     |  subn(self, /, repl, string, count=0)\n",
      "     |      Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  flags\n",
      "     |      The regex matching flags.\n",
      "     |  \n",
      "     |  groupindex\n",
      "     |      A dictionary mapping group names to group numbers.\n",
      "     |  \n",
      "     |  groups\n",
      "     |      The number of capturing groups in the pattern.\n",
      "     |  \n",
      "     |  pattern\n",
      "     |      The pattern string from which the RE object was compiled.\n",
      "    \n",
      "    class error(builtins.Exception)\n",
      "     |  error(msg, pattern=None, pos=None)\n",
      "     |  \n",
      "     |  Exception raised for invalid regular expressions.\n",
      "     |  \n",
      "     |  Attributes:\n",
      "     |  \n",
      "     |      msg: The unformatted error message\n",
      "     |      pattern: The regular expression pattern\n",
      "     |      pos: The index in the pattern where compilation failed (may be None)\n",
      "     |      lineno: The line corresponding to pos (may be None)\n",
      "     |      colno: The column corresponding to pos (may be None)\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      error\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, msg, pattern=None, pos=None)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.Exception:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "\n",
      "FUNCTIONS\n",
      "    compile(pattern, flags=0)\n",
      "        Compile a regular expression pattern, returning a Pattern object.\n",
      "    \n",
      "    escape(pattern)\n",
      "        Escape special characters in a string.\n",
      "    \n",
      "    findall(pattern, string, flags=0)\n",
      "        Return a list of all non-overlapping matches in the string.\n",
      "        \n",
      "        If one or more capturing groups are present in the pattern, return\n",
      "        a list of groups; this will be a list of tuples if the pattern\n",
      "        has more than one group.\n",
      "        \n",
      "        Empty matches are included in the result.\n",
      "    \n",
      "    finditer(pattern, string, flags=0)\n",
      "        Return an iterator over all non-overlapping matches in the\n",
      "        string.  For each match, the iterator returns a Match object.\n",
      "        \n",
      "        Empty matches are included in the result.\n",
      "    \n",
      "    fullmatch(pattern, string, flags=0)\n",
      "        Try to apply the pattern to all of the string, returning\n",
      "        a Match object, or None if no match was found.\n",
      "    \n",
      "    match(pattern, string, flags=0)\n",
      "        Try to apply the pattern at the start of the string, returning\n",
      "        a Match object, or None if no match was found.\n",
      "    \n",
      "    purge()\n",
      "        Clear the regular expression caches\n",
      "    \n",
      "    search(pattern, string, flags=0)\n",
      "        Scan through string looking for a match to the pattern, returning\n",
      "        a Match object, or None if no match was found.\n",
      "    \n",
      "    split(pattern, string, maxsplit=0, flags=0)\n",
      "        Split the source string by the occurrences of the pattern,\n",
      "        returning a list containing the resulting substrings.  If\n",
      "        capturing parentheses are used in pattern, then the text of all\n",
      "        groups in the pattern are also returned as part of the resulting\n",
      "        list.  If maxsplit is nonzero, at most maxsplit splits occur,\n",
      "        and the remainder of the string is returned as the final element\n",
      "        of the list.\n",
      "    \n",
      "    sub(pattern, repl, string, count=0, flags=0)\n",
      "        Return the string obtained by replacing the leftmost\n",
      "        non-overlapping occurrences of the pattern in string by the\n",
      "        replacement repl.  repl can be either a string or a callable;\n",
      "        if a string, backslash escapes in it are processed.  If it is\n",
      "        a callable, it's passed the Match object and must return\n",
      "        a replacement string to be used.\n",
      "    \n",
      "    subn(pattern, repl, string, count=0, flags=0)\n",
      "        Return a 2-tuple containing (new_string, number).\n",
      "        new_string is the string obtained by replacing the leftmost\n",
      "        non-overlapping occurrences of the pattern in the source\n",
      "        string by the replacement repl.  number is the number of\n",
      "        substitutions that were made. repl can be either a string or a\n",
      "        callable; if a string, backslash escapes in it are processed.\n",
      "        If it is a callable, it's passed the Match object and must\n",
      "        return a replacement string to be used.\n",
      "    \n",
      "    template(pattern, flags=0)\n",
      "        Compile a template pattern, returning a Pattern object\n",
      "\n",
      "DATA\n",
      "    A = re.ASCII\n",
      "    ASCII = re.ASCII\n",
      "    DOTALL = re.DOTALL\n",
      "    I = re.IGNORECASE\n",
      "    IGNORECASE = re.IGNORECASE\n",
      "    L = re.LOCALE\n",
      "    LOCALE = re.LOCALE\n",
      "    M = re.MULTILINE\n",
      "    MULTILINE = re.MULTILINE\n",
      "    S = re.DOTALL\n",
      "    U = re.UNICODE\n",
      "    UNICODE = re.UNICODE\n",
      "    VERBOSE = re.VERBOSE\n",
      "    X = re.VERBOSE\n",
      "    __all__ = ['match', 'fullmatch', 'search', 'sub', 'subn', 'split', 'fi...\n",
      "\n",
      "VERSION\n",
      "    2.2.1\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\re.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(re)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "40a7653f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'tea for two'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'tea for too'.replace('too', 'two')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d4fcbc6e",
   "metadata": {},
   "source": [
    "#### 5. math 数学\n",
    "* 为浮点运算提供了对底层C函数库的访问 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "6ef4e85c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in module math:\n",
      "\n",
      "NAME\n",
      "    math\n",
      "\n",
      "DESCRIPTION\n",
      "    This module provides access to the mathematical functions\n",
      "    defined by the C standard.\n",
      "\n",
      "FUNCTIONS\n",
      "    acos(x, /)\n",
      "        Return the arc cosine (measured in radians) of x.\n",
      "    \n",
      "    acosh(x, /)\n",
      "        Return the inverse hyperbolic cosine of x.\n",
      "    \n",
      "    asin(x, /)\n",
      "        Return the arc sine (measured in radians) of x.\n",
      "    \n",
      "    asinh(x, /)\n",
      "        Return the inverse hyperbolic sine of x.\n",
      "    \n",
      "    atan(x, /)\n",
      "        Return the arc tangent (measured in radians) of x.\n",
      "    \n",
      "    atan2(y, x, /)\n",
      "        Return the arc tangent (measured in radians) of y/x.\n",
      "        \n",
      "        Unlike atan(y/x), the signs of both x and y are considered.\n",
      "    \n",
      "    atanh(x, /)\n",
      "        Return the inverse hyperbolic tangent of x.\n",
      "    \n",
      "    ceil(x, /)\n",
      "        Return the ceiling of x as an Integral.\n",
      "        \n",
      "        This is the smallest integer >= x.\n",
      "    \n",
      "    comb(n, k, /)\n",
      "        Number of ways to choose k items from n items without repetition and without order.\n",
      "        \n",
      "        Evaluates to n! / (k! * (n - k)!) when k <= n and evaluates\n",
      "        to zero when k > n.\n",
      "        \n",
      "        Also called the binomial coefficient because it is equivalent\n",
      "        to the coefficient of k-th term in polynomial expansion of the\n",
      "        expression (1 + x)**n.\n",
      "        \n",
      "        Raises TypeError if either of the arguments are not integers.\n",
      "        Raises ValueError if either of the arguments are negative.\n",
      "    \n",
      "    copysign(x, y, /)\n",
      "        Return a float with the magnitude (absolute value) of x but the sign of y.\n",
      "        \n",
      "        On platforms that support signed zeros, copysign(1.0, -0.0)\n",
      "        returns -1.0.\n",
      "    \n",
      "    cos(x, /)\n",
      "        Return the cosine of x (measured in radians).\n",
      "    \n",
      "    cosh(x, /)\n",
      "        Return the hyperbolic cosine of x.\n",
      "    \n",
      "    degrees(x, /)\n",
      "        Convert angle x from radians to degrees.\n",
      "    \n",
      "    dist(p, q, /)\n",
      "        Return the Euclidean distance between two points p and q.\n",
      "        \n",
      "        The points should be specified as sequences (or iterables) of\n",
      "        coordinates.  Both inputs must have the same dimension.\n",
      "        \n",
      "        Roughly equivalent to:\n",
      "            sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))\n",
      "    \n",
      "    erf(x, /)\n",
      "        Error function at x.\n",
      "    \n",
      "    erfc(x, /)\n",
      "        Complementary error function at x.\n",
      "    \n",
      "    exp(x, /)\n",
      "        Return e raised to the power of x.\n",
      "    \n",
      "    expm1(x, /)\n",
      "        Return exp(x)-1.\n",
      "        \n",
      "        This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.\n",
      "    \n",
      "    fabs(x, /)\n",
      "        Return the absolute value of the float x.\n",
      "    \n",
      "    factorial(x, /)\n",
      "        Find x!.\n",
      "        \n",
      "        Raise a ValueError if x is negative or non-integral.\n",
      "    \n",
      "    floor(x, /)\n",
      "        Return the floor of x as an Integral.\n",
      "        \n",
      "        This is the largest integer <= x.\n",
      "    \n",
      "    fmod(x, y, /)\n",
      "        Return fmod(x, y), according to platform C.\n",
      "        \n",
      "        x % y may differ.\n",
      "    \n",
      "    frexp(x, /)\n",
      "        Return the mantissa and exponent of x, as pair (m, e).\n",
      "        \n",
      "        m is a float and e is an int, such that x = m * 2.**e.\n",
      "        If x is 0, m and e are both 0.  Else 0.5 <= abs(m) < 1.0.\n",
      "    \n",
      "    fsum(seq, /)\n",
      "        Return an accurate floating point sum of values in the iterable seq.\n",
      "        \n",
      "        Assumes IEEE-754 floating point arithmetic.\n",
      "    \n",
      "    gamma(x, /)\n",
      "        Gamma function at x.\n",
      "    \n",
      "    gcd(x, y, /)\n",
      "        greatest common divisor of x and y\n",
      "    \n",
      "    hypot(...)\n",
      "        hypot(*coordinates) -> value\n",
      "        \n",
      "        Multidimensional Euclidean distance from the origin to a point.\n",
      "        \n",
      "        Roughly equivalent to:\n",
      "            sqrt(sum(x**2 for x in coordinates))\n",
      "        \n",
      "        For a two dimensional point (x, y), gives the hypotenuse\n",
      "        using the Pythagorean theorem:  sqrt(x*x + y*y).\n",
      "        \n",
      "        For example, the hypotenuse of a 3/4/5 right triangle is:\n",
      "        \n",
      "            >>> hypot(3.0, 4.0)\n",
      "            5.0\n",
      "    \n",
      "    isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)\n",
      "        Determine whether two floating point numbers are close in value.\n",
      "        \n",
      "          rel_tol\n",
      "            maximum difference for being considered \"close\", relative to the\n",
      "            magnitude of the input values\n",
      "          abs_tol\n",
      "            maximum difference for being considered \"close\", regardless of the\n",
      "            magnitude of the input values\n",
      "        \n",
      "        Return True if a is close in value to b, and False otherwise.\n",
      "        \n",
      "        For the values to be considered close, the difference between them\n",
      "        must be smaller than at least one of the tolerances.\n",
      "        \n",
      "        -inf, inf and NaN behave similarly to the IEEE 754 Standard.  That\n",
      "        is, NaN is not close to anything, even itself.  inf and -inf are\n",
      "        only close to themselves.\n",
      "    \n",
      "    isfinite(x, /)\n",
      "        Return True if x is neither an infinity nor a NaN, and False otherwise.\n",
      "    \n",
      "    isinf(x, /)\n",
      "        Return True if x is a positive or negative infinity, and False otherwise.\n",
      "    \n",
      "    isnan(x, /)\n",
      "        Return True if x is a NaN (not a number), and False otherwise.\n",
      "    \n",
      "    isqrt(n, /)\n",
      "        Return the integer part of the square root of the input.\n",
      "    \n",
      "    ldexp(x, i, /)\n",
      "        Return x * (2**i).\n",
      "        \n",
      "        This is essentially the inverse of frexp().\n",
      "    \n",
      "    lgamma(x, /)\n",
      "        Natural logarithm of absolute value of Gamma function at x.\n",
      "    \n",
      "    log(...)\n",
      "        log(x, [base=math.e])\n",
      "        Return the logarithm of x to the given base.\n",
      "        \n",
      "        If the base not specified, returns the natural logarithm (base e) of x.\n",
      "    \n",
      "    log10(x, /)\n",
      "        Return the base 10 logarithm of x.\n",
      "    \n",
      "    log1p(x, /)\n",
      "        Return the natural logarithm of 1+x (base e).\n",
      "        \n",
      "        The result is computed in a way which is accurate for x near zero.\n",
      "    \n",
      "    log2(x, /)\n",
      "        Return the base 2 logarithm of x.\n",
      "    \n",
      "    modf(x, /)\n",
      "        Return the fractional and integer parts of x.\n",
      "        \n",
      "        Both results carry the sign of x and are floats.\n",
      "    \n",
      "    perm(n, k=None, /)\n",
      "        Number of ways to choose k items from n items without repetition and with order.\n",
      "        \n",
      "        Evaluates to n! / (n - k)! when k <= n and evaluates\n",
      "        to zero when k > n.\n",
      "        \n",
      "        If k is not specified or is None, then k defaults to n\n",
      "        and the function returns n!.\n",
      "        \n",
      "        Raises TypeError if either of the arguments are not integers.\n",
      "        Raises ValueError if either of the arguments are negative.\n",
      "    \n",
      "    pow(x, y, /)\n",
      "        Return x**y (x to the power of y).\n",
      "    \n",
      "    prod(iterable, /, *, start=1)\n",
      "        Calculate the product of all the elements in the input iterable.\n",
      "        \n",
      "        The default start value for the product is 1.\n",
      "        \n",
      "        When the iterable is empty, return the start value.  This function is\n",
      "        intended specifically for use with numeric values and may reject\n",
      "        non-numeric types.\n",
      "    \n",
      "    radians(x, /)\n",
      "        Convert angle x from degrees to radians.\n",
      "    \n",
      "    remainder(x, y, /)\n",
      "        Difference between x and the closest integer multiple of y.\n",
      "        \n",
      "        Return x - n*y where n*y is the closest integer multiple of y.\n",
      "        In the case where x is exactly halfway between two multiples of\n",
      "        y, the nearest even value of n is used. The result is always exact.\n",
      "    \n",
      "    sin(x, /)\n",
      "        Return the sine of x (measured in radians).\n",
      "    \n",
      "    sinh(x, /)\n",
      "        Return the hyperbolic sine of x.\n",
      "    \n",
      "    sqrt(x, /)\n",
      "        Return the square root of x.\n",
      "    \n",
      "    tan(x, /)\n",
      "        Return the tangent of x (measured in radians).\n",
      "    \n",
      "    tanh(x, /)\n",
      "        Return the hyperbolic tangent of x.\n",
      "    \n",
      "    trunc(x, /)\n",
      "        Truncates the Real x to the nearest Integral toward 0.\n",
      "        \n",
      "        Uses the __trunc__ magic method.\n",
      "\n",
      "DATA\n",
      "    e = 2.718281828459045\n",
      "    inf = inf\n",
      "    nan = nan\n",
      "    pi = 3.141592653589793\n",
      "    tau = 6.283185307179586\n",
      "\n",
      "FILE\n",
      "    (built-in)\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "help(math)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "89e1bed0",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on module numbers:\n",
      "\n",
      "NAME\n",
      "    numbers - Abstract Base Classes (ABCs) for numbers, according to PEP 3141.\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/numbers\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "DESCRIPTION\n",
      "    TODO: Fill out more detailed documentation on the operators.\n",
      "\n",
      "CLASSES\n",
      "    builtins.object\n",
      "        Number\n",
      "            Complex\n",
      "                Real\n",
      "                    Rational\n",
      "                        Integral\n",
      "    \n",
      "    class Complex(Number)\n",
      "     |  Complex defines the operations that work on the builtin complex type.\n",
      "     |  \n",
      "     |  In short, those are: a conversion to complex, .real, .imag, +, -,\n",
      "     |  *, /, abs(), .conjugate, ==, and !=.\n",
      "     |  \n",
      "     |  If it is given heterogeneous arguments, and doesn't have special\n",
      "     |  knowledge about them, it should fall back to the builtin complex\n",
      "     |  type as described below.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      Complex\n",
      "     |      Number\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |      Returns the Real distance from 0. Called for abs(self).\n",
      "     |  \n",
      "     |  __add__(self, other)\n",
      "     |      self + other\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |      True if self != 0. Called for bool(self).\n",
      "     |  \n",
      "     |  __complex__(self)\n",
      "     |      Return a builtin complex instance. Called for complex(self).\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      self == other\n",
      "     |  \n",
      "     |  __mul__(self, other)\n",
      "     |      self * other\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |      -self\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |      +self\n",
      "     |  \n",
      "     |  __pow__(self, exponent)\n",
      "     |      self**exponent; should promote to float or complex when necessary.\n",
      "     |  \n",
      "     |  __radd__(self, other)\n",
      "     |      other + self\n",
      "     |  \n",
      "     |  __rmul__(self, other)\n",
      "     |      other * self\n",
      "     |  \n",
      "     |  __rpow__(self, base)\n",
      "     |      base ** self\n",
      "     |  \n",
      "     |  __rsub__(self, other)\n",
      "     |      other - self\n",
      "     |  \n",
      "     |  __rtruediv__(self, other)\n",
      "     |      other / self\n",
      "     |  \n",
      "     |  __sub__(self, other)\n",
      "     |      self - other\n",
      "     |  \n",
      "     |  __truediv__(self, other)\n",
      "     |      self / other: Should promote to float when necessary.\n",
      "     |  \n",
      "     |  conjugate(self)\n",
      "     |      (x+y*i).conjugate() returns (x-y*i).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  imag\n",
      "     |      Retrieve the imaginary component of this number.\n",
      "     |      \n",
      "     |      This should subclass Real.\n",
      "     |  \n",
      "     |  real\n",
      "     |      Retrieve the real component of this number.\n",
      "     |      \n",
      "     |      This should subclass Real.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  __abstractmethods__ = frozenset({'__abs__', '__add__', '__complex__', ...\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class Integral(Rational)\n",
      "     |  Integral adds a conversion to int and the bit-string operations.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      Integral\n",
      "     |      Rational\n",
      "     |      Real\n",
      "     |      Complex\n",
      "     |      Number\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __and__(self, other)\n",
      "     |      self & other\n",
      "     |  \n",
      "     |  __float__(self)\n",
      "     |      float(self) == float(int(self))\n",
      "     |  \n",
      "     |  __index__(self)\n",
      "     |      Called whenever an index is needed, such as in slicing\n",
      "     |  \n",
      "     |  __int__(self)\n",
      "     |      int(self)\n",
      "     |  \n",
      "     |  __invert__(self)\n",
      "     |      ~self\n",
      "     |  \n",
      "     |  __lshift__(self, other)\n",
      "     |      self << other\n",
      "     |  \n",
      "     |  __or__(self, other)\n",
      "     |      self | other\n",
      "     |  \n",
      "     |  __pow__(self, exponent, modulus=None)\n",
      "     |      self ** exponent % modulus, but maybe faster.\n",
      "     |      \n",
      "     |      Accept the modulus argument if you want to support the\n",
      "     |      3-argument version of pow(). Raise a TypeError if exponent < 0\n",
      "     |      or any argument isn't Integral. Otherwise, just implement the\n",
      "     |      2-argument version described in Complex.\n",
      "     |  \n",
      "     |  __rand__(self, other)\n",
      "     |      other & self\n",
      "     |  \n",
      "     |  __rlshift__(self, other)\n",
      "     |      other << self\n",
      "     |  \n",
      "     |  __ror__(self, other)\n",
      "     |      other | self\n",
      "     |  \n",
      "     |  __rrshift__(self, other)\n",
      "     |      other >> self\n",
      "     |  \n",
      "     |  __rshift__(self, other)\n",
      "     |      self >> other\n",
      "     |  \n",
      "     |  __rxor__(self, other)\n",
      "     |      other ^ self\n",
      "     |  \n",
      "     |  __xor__(self, other)\n",
      "     |      self ^ other\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  denominator\n",
      "     |      Integers have a denominator of 1.\n",
      "     |  \n",
      "     |  numerator\n",
      "     |      Integers are their own numerators.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  __abstractmethods__ = frozenset({'__abs__', '__add__', '__and__', '__c...\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from Real:\n",
      "     |  \n",
      "     |  __ceil__(self)\n",
      "     |      Finds the least Integral >= self.\n",
      "     |  \n",
      "     |  __complex__(self)\n",
      "     |      complex(self) == complex(float(self), 0)\n",
      "     |  \n",
      "     |  __divmod__(self, other)\n",
      "     |      divmod(self, other): The pair (self // other, self % other).\n",
      "     |      \n",
      "     |      Sometimes this can be computed faster than the pair of\n",
      "     |      operations.\n",
      "     |  \n",
      "     |  __floor__(self)\n",
      "     |      Finds the greatest Integral <= self.\n",
      "     |  \n",
      "     |  __floordiv__(self, other)\n",
      "     |      self // other: The floor() of self/other.\n",
      "     |  \n",
      "     |  __le__(self, other)\n",
      "     |      self <= other\n",
      "     |  \n",
      "     |  __lt__(self, other)\n",
      "     |      self < other\n",
      "     |      \n",
      "     |      < on Reals defines a total ordering, except perhaps for NaN.\n",
      "     |  \n",
      "     |  __mod__(self, other)\n",
      "     |      self % other\n",
      "     |  \n",
      "     |  __rdivmod__(self, other)\n",
      "     |      divmod(other, self): The pair (self // other, self % other).\n",
      "     |      \n",
      "     |      Sometimes this can be computed faster than the pair of\n",
      "     |      operations.\n",
      "     |  \n",
      "     |  __rfloordiv__(self, other)\n",
      "     |      other // self: The floor() of other/self.\n",
      "     |  \n",
      "     |  __rmod__(self, other)\n",
      "     |      other % self\n",
      "     |  \n",
      "     |  __round__(self, ndigits=None)\n",
      "     |      Rounds self to ndigits decimal places, defaulting to 0.\n",
      "     |      \n",
      "     |      If ndigits is omitted or None, returns an Integral, otherwise\n",
      "     |      returns a Real. Rounds half toward even.\n",
      "     |  \n",
      "     |  __trunc__(self)\n",
      "     |      trunc(self): Truncates self to an Integral.\n",
      "     |      \n",
      "     |      Returns an Integral i such that:\n",
      "     |        * i>0 iff self>0;\n",
      "     |        * abs(i) <= abs(self);\n",
      "     |        * for any Integral j satisfying the first two conditions,\n",
      "     |          abs(i) >= abs(j) [i.e. i has \"maximal\" abs among those].\n",
      "     |      i.e. \"truncate towards 0\".\n",
      "     |  \n",
      "     |  conjugate(self)\n",
      "     |      Conjugate is a no-op for Reals.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties inherited from Real:\n",
      "     |  \n",
      "     |  imag\n",
      "     |      Real numbers have no imaginary component.\n",
      "     |  \n",
      "     |  real\n",
      "     |      Real numbers are their real component.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from Complex:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |      Returns the Real distance from 0. Called for abs(self).\n",
      "     |  \n",
      "     |  __add__(self, other)\n",
      "     |      self + other\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |      True if self != 0. Called for bool(self).\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      self == other\n",
      "     |  \n",
      "     |  __mul__(self, other)\n",
      "     |      self * other\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |      -self\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |      +self\n",
      "     |  \n",
      "     |  __radd__(self, other)\n",
      "     |      other + self\n",
      "     |  \n",
      "     |  __rmul__(self, other)\n",
      "     |      other * self\n",
      "     |  \n",
      "     |  __rpow__(self, base)\n",
      "     |      base ** self\n",
      "     |  \n",
      "     |  __rsub__(self, other)\n",
      "     |      other - self\n",
      "     |  \n",
      "     |  __rtruediv__(self, other)\n",
      "     |      other / self\n",
      "     |  \n",
      "     |  __sub__(self, other)\n",
      "     |      self - other\n",
      "     |  \n",
      "     |  __truediv__(self, other)\n",
      "     |      self / other: Should promote to float when necessary.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from Complex:\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class Number(builtins.object)\n",
      "     |  All numbers inherit from this class.\n",
      "     |  \n",
      "     |  If you just want to check if an argument x is a number, without\n",
      "     |  caring what kind, use isinstance(x, Number).\n",
      "     |  \n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  __abstractmethods__ = frozenset()\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class Rational(Real)\n",
      "     |  .numerator and .denominator should be in lowest terms.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      Rational\n",
      "     |      Real\n",
      "     |      Complex\n",
      "     |      Number\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __float__(self)\n",
      "     |      float(self) = self.numerator / self.denominator\n",
      "     |      \n",
      "     |      It's important that this conversion use the integer's \"true\"\n",
      "     |      division rather than casting one side to float before dividing\n",
      "     |      so that ratios of huge integers convert without overflowing.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  denominator\n",
      "     |  \n",
      "     |  numerator\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  __abstractmethods__ = frozenset({'__abs__', '__add__', '__ceil__', '__...\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from Real:\n",
      "     |  \n",
      "     |  __ceil__(self)\n",
      "     |      Finds the least Integral >= self.\n",
      "     |  \n",
      "     |  __complex__(self)\n",
      "     |      complex(self) == complex(float(self), 0)\n",
      "     |  \n",
      "     |  __divmod__(self, other)\n",
      "     |      divmod(self, other): The pair (self // other, self % other).\n",
      "     |      \n",
      "     |      Sometimes this can be computed faster than the pair of\n",
      "     |      operations.\n",
      "     |  \n",
      "     |  __floor__(self)\n",
      "     |      Finds the greatest Integral <= self.\n",
      "     |  \n",
      "     |  __floordiv__(self, other)\n",
      "     |      self // other: The floor() of self/other.\n",
      "     |  \n",
      "     |  __le__(self, other)\n",
      "     |      self <= other\n",
      "     |  \n",
      "     |  __lt__(self, other)\n",
      "     |      self < other\n",
      "     |      \n",
      "     |      < on Reals defines a total ordering, except perhaps for NaN.\n",
      "     |  \n",
      "     |  __mod__(self, other)\n",
      "     |      self % other\n",
      "     |  \n",
      "     |  __rdivmod__(self, other)\n",
      "     |      divmod(other, self): The pair (self // other, self % other).\n",
      "     |      \n",
      "     |      Sometimes this can be computed faster than the pair of\n",
      "     |      operations.\n",
      "     |  \n",
      "     |  __rfloordiv__(self, other)\n",
      "     |      other // self: The floor() of other/self.\n",
      "     |  \n",
      "     |  __rmod__(self, other)\n",
      "     |      other % self\n",
      "     |  \n",
      "     |  __round__(self, ndigits=None)\n",
      "     |      Rounds self to ndigits decimal places, defaulting to 0.\n",
      "     |      \n",
      "     |      If ndigits is omitted or None, returns an Integral, otherwise\n",
      "     |      returns a Real. Rounds half toward even.\n",
      "     |  \n",
      "     |  __trunc__(self)\n",
      "     |      trunc(self): Truncates self to an Integral.\n",
      "     |      \n",
      "     |      Returns an Integral i such that:\n",
      "     |        * i>0 iff self>0;\n",
      "     |        * abs(i) <= abs(self);\n",
      "     |        * for any Integral j satisfying the first two conditions,\n",
      "     |          abs(i) >= abs(j) [i.e. i has \"maximal\" abs among those].\n",
      "     |      i.e. \"truncate towards 0\".\n",
      "     |  \n",
      "     |  conjugate(self)\n",
      "     |      Conjugate is a no-op for Reals.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties inherited from Real:\n",
      "     |  \n",
      "     |  imag\n",
      "     |      Real numbers have no imaginary component.\n",
      "     |  \n",
      "     |  real\n",
      "     |      Real numbers are their real component.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from Complex:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |      Returns the Real distance from 0. Called for abs(self).\n",
      "     |  \n",
      "     |  __add__(self, other)\n",
      "     |      self + other\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |      True if self != 0. Called for bool(self).\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      self == other\n",
      "     |  \n",
      "     |  __mul__(self, other)\n",
      "     |      self * other\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |      -self\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |      +self\n",
      "     |  \n",
      "     |  __pow__(self, exponent)\n",
      "     |      self**exponent; should promote to float or complex when necessary.\n",
      "     |  \n",
      "     |  __radd__(self, other)\n",
      "     |      other + self\n",
      "     |  \n",
      "     |  __rmul__(self, other)\n",
      "     |      other * self\n",
      "     |  \n",
      "     |  __rpow__(self, base)\n",
      "     |      base ** self\n",
      "     |  \n",
      "     |  __rsub__(self, other)\n",
      "     |      other - self\n",
      "     |  \n",
      "     |  __rtruediv__(self, other)\n",
      "     |      other / self\n",
      "     |  \n",
      "     |  __sub__(self, other)\n",
      "     |      self - other\n",
      "     |  \n",
      "     |  __truediv__(self, other)\n",
      "     |      self / other: Should promote to float when necessary.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from Complex:\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class Real(Complex)\n",
      "     |  To Complex, Real adds the operations that work on real numbers.\n",
      "     |  \n",
      "     |  In short, those are: a conversion to float, trunc(), divmod,\n",
      "     |  %, <, <=, >, and >=.\n",
      "     |  \n",
      "     |  Real also provides defaults for the derived operations.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      Real\n",
      "     |      Complex\n",
      "     |      Number\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __ceil__(self)\n",
      "     |      Finds the least Integral >= self.\n",
      "     |  \n",
      "     |  __complex__(self)\n",
      "     |      complex(self) == complex(float(self), 0)\n",
      "     |  \n",
      "     |  __divmod__(self, other)\n",
      "     |      divmod(self, other): The pair (self // other, self % other).\n",
      "     |      \n",
      "     |      Sometimes this can be computed faster than the pair of\n",
      "     |      operations.\n",
      "     |  \n",
      "     |  __float__(self)\n",
      "     |      Any Real can be converted to a native float object.\n",
      "     |      \n",
      "     |      Called for float(self).\n",
      "     |  \n",
      "     |  __floor__(self)\n",
      "     |      Finds the greatest Integral <= self.\n",
      "     |  \n",
      "     |  __floordiv__(self, other)\n",
      "     |      self // other: The floor() of self/other.\n",
      "     |  \n",
      "     |  __le__(self, other)\n",
      "     |      self <= other\n",
      "     |  \n",
      "     |  __lt__(self, other)\n",
      "     |      self < other\n",
      "     |      \n",
      "     |      < on Reals defines a total ordering, except perhaps for NaN.\n",
      "     |  \n",
      "     |  __mod__(self, other)\n",
      "     |      self % other\n",
      "     |  \n",
      "     |  __rdivmod__(self, other)\n",
      "     |      divmod(other, self): The pair (self // other, self % other).\n",
      "     |      \n",
      "     |      Sometimes this can be computed faster than the pair of\n",
      "     |      operations.\n",
      "     |  \n",
      "     |  __rfloordiv__(self, other)\n",
      "     |      other // self: The floor() of other/self.\n",
      "     |  \n",
      "     |  __rmod__(self, other)\n",
      "     |      other % self\n",
      "     |  \n",
      "     |  __round__(self, ndigits=None)\n",
      "     |      Rounds self to ndigits decimal places, defaulting to 0.\n",
      "     |      \n",
      "     |      If ndigits is omitted or None, returns an Integral, otherwise\n",
      "     |      returns a Real. Rounds half toward even.\n",
      "     |  \n",
      "     |  __trunc__(self)\n",
      "     |      trunc(self): Truncates self to an Integral.\n",
      "     |      \n",
      "     |      Returns an Integral i such that:\n",
      "     |        * i>0 iff self>0;\n",
      "     |        * abs(i) <= abs(self);\n",
      "     |        * for any Integral j satisfying the first two conditions,\n",
      "     |          abs(i) >= abs(j) [i.e. i has \"maximal\" abs among those].\n",
      "     |      i.e. \"truncate towards 0\".\n",
      "     |  \n",
      "     |  conjugate(self)\n",
      "     |      Conjugate is a no-op for Reals.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Readonly properties defined here:\n",
      "     |  \n",
      "     |  imag\n",
      "     |      Real numbers have no imaginary component.\n",
      "     |  \n",
      "     |  real\n",
      "     |      Real numbers are their real component.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  __abstractmethods__ = frozenset({'__abs__', '__add__', '__ceil__', '__...\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from Complex:\n",
      "     |  \n",
      "     |  __abs__(self)\n",
      "     |      Returns the Real distance from 0. Called for abs(self).\n",
      "     |  \n",
      "     |  __add__(self, other)\n",
      "     |      self + other\n",
      "     |  \n",
      "     |  __bool__(self)\n",
      "     |      True if self != 0. Called for bool(self).\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      self == other\n",
      "     |  \n",
      "     |  __mul__(self, other)\n",
      "     |      self * other\n",
      "     |  \n",
      "     |  __neg__(self)\n",
      "     |      -self\n",
      "     |  \n",
      "     |  __pos__(self)\n",
      "     |      +self\n",
      "     |  \n",
      "     |  __pow__(self, exponent)\n",
      "     |      self**exponent; should promote to float or complex when necessary.\n",
      "     |  \n",
      "     |  __radd__(self, other)\n",
      "     |      other + self\n",
      "     |  \n",
      "     |  __rmul__(self, other)\n",
      "     |      other * self\n",
      "     |  \n",
      "     |  __rpow__(self, base)\n",
      "     |      base ** self\n",
      "     |  \n",
      "     |  __rsub__(self, other)\n",
      "     |      other - self\n",
      "     |  \n",
      "     |  __rtruediv__(self, other)\n",
      "     |      other / self\n",
      "     |  \n",
      "     |  __sub__(self, other)\n",
      "     |      self - other\n",
      "     |  \n",
      "     |  __truediv__(self, other)\n",
      "     |      self / other: Should promote to float when necessary.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from Complex:\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "\n",
      "DATA\n",
      "    __all__ = ['Number', 'Complex', 'Real', 'Rational', 'Integral']\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\numbers.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import numbers\n",
    "help(numbers)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "5ce14ba2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.0"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "math.log(1024, 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d5dfa252",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'pear'"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import random   # random提供了生成随机数的工具\n",
    "random.choice(['apple', 'pear', 'banana'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "ec79fb8d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.2129726591809239"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "random.random() "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c9622f3d",
   "metadata": {},
   "source": [
    "#### 6. datetime 日期和时间\n",
    "* 支持日期和时间算法的同时，更有效的处理和格式化输出"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "564ccd1a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2021-09-28\n"
     ]
    }
   ],
   "source": [
    "from datetime import date\n",
    "now = date.today()\n",
    "print(now)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "bdf10203",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on module datetime:\n",
      "\n",
      "NAME\n",
      "    datetime - Fast implementation of the datetime type.\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/datetime\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "CLASSES\n",
      "    builtins.object\n",
      "        date\n",
      "            datetime\n",
      "        time\n",
      "        timedelta\n",
      "        tzinfo\n",
      "            timezone\n",
      "    \n",
      "    class date(builtins.object)\n",
      "     |  date(year, month, day) --> date object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __format__(...)\n",
      "     |      Formats self with strftime.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __radd__(self, value, /)\n",
      "     |      Return value+self.\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      __reduce__() -> (cls, state)\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __rsub__(self, value, /)\n",
      "     |      Return value-self.\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  __sub__(self, value, /)\n",
      "     |      Return self-value.\n",
      "     |  \n",
      "     |  ctime(...)\n",
      "     |      Return ctime() style string.\n",
      "     |  \n",
      "     |  isocalendar(...)\n",
      "     |      Return a 3-tuple containing ISO year, week number, and weekday.\n",
      "     |  \n",
      "     |  isoformat(...)\n",
      "     |      Return string in ISO 8601 format, YYYY-MM-DD.\n",
      "     |  \n",
      "     |  isoweekday(...)\n",
      "     |      Return the day of the week represented by the date.\n",
      "     |      Monday == 1 ... Sunday == 7\n",
      "     |  \n",
      "     |  replace(...)\n",
      "     |      Return date with new specified fields.\n",
      "     |  \n",
      "     |  strftime(...)\n",
      "     |      format -> strftime() style string.\n",
      "     |  \n",
      "     |  timetuple(...)\n",
      "     |      Return time tuple, compatible with time.localtime().\n",
      "     |  \n",
      "     |  toordinal(...)\n",
      "     |      Return proleptic Gregorian ordinal.  January 1 of year 1 is day 1.\n",
      "     |  \n",
      "     |  weekday(...)\n",
      "     |      Return the day of the week represented by the date.\n",
      "     |      Monday == 0 ... Sunday == 6\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods defined here:\n",
      "     |  \n",
      "     |  fromisocalendar(...) from builtins.type\n",
      "     |      int, int, int -> Construct a date from the ISO year, week number and weekday.\n",
      "     |      \n",
      "     |      This is the inverse of the date.isocalendar() function\n",
      "     |  \n",
      "     |  fromisoformat(...) from builtins.type\n",
      "     |      str -> Construct a date from the output of date.isoformat()\n",
      "     |  \n",
      "     |  fromordinal(...) from builtins.type\n",
      "     |      int -> date corresponding to a proleptic Gregorian ordinal.\n",
      "     |  \n",
      "     |  fromtimestamp(timestamp, /) from builtins.type\n",
      "     |      Create a date from a POSIX timestamp.\n",
      "     |      \n",
      "     |      The timestamp is a number, e.g. created via time.time(), that is interpreted\n",
      "     |      as local time.\n",
      "     |  \n",
      "     |  today(...) from builtins.type\n",
      "     |      Current date or datetime:  same as self.__class__.fromtimestamp(time.time()).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  day\n",
      "     |  \n",
      "     |  month\n",
      "     |  \n",
      "     |  year\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  max = datetime.date(9999, 12, 31)\n",
      "     |  \n",
      "     |  min = datetime.date(1, 1, 1)\n",
      "     |  \n",
      "     |  resolution = datetime.timedelta(days=1)\n",
      "    \n",
      "    class datetime(date)\n",
      "     |  datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n",
      "     |  \n",
      "     |  The year, month and day arguments are required. tzinfo may be None, or an\n",
      "     |  instance of a tzinfo subclass. The remaining arguments may be ints.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      datetime\n",
      "     |      date\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __radd__(self, value, /)\n",
      "     |      Return value+self.\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      __reduce__() -> (cls, state)\n",
      "     |  \n",
      "     |  __reduce_ex__(...)\n",
      "     |      __reduce_ex__(proto) -> (cls, state)\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __rsub__(self, value, /)\n",
      "     |      Return value-self.\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  __sub__(self, value, /)\n",
      "     |      Return self-value.\n",
      "     |  \n",
      "     |  astimezone(...)\n",
      "     |      tz -> convert to local time in new timezone tz\n",
      "     |  \n",
      "     |  ctime(...)\n",
      "     |      Return ctime() style string.\n",
      "     |  \n",
      "     |  date(...)\n",
      "     |      Return date object with same year, month and day.\n",
      "     |  \n",
      "     |  dst(...)\n",
      "     |      Return self.tzinfo.dst(self).\n",
      "     |  \n",
      "     |  isoformat(...)\n",
      "     |      [sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n",
      "     |      sep is used to separate the year from the time, and defaults to 'T'.\n",
      "     |      The optional argument timespec specifies the number of additional terms\n",
      "     |      of the time to include. Valid options are 'auto', 'hours', 'minutes',\n",
      "     |      'seconds', 'milliseconds' and 'microseconds'.\n",
      "     |  \n",
      "     |  replace(...)\n",
      "     |      Return datetime with new specified fields.\n",
      "     |  \n",
      "     |  time(...)\n",
      "     |      Return time object with same time but with tzinfo=None.\n",
      "     |  \n",
      "     |  timestamp(...)\n",
      "     |      Return POSIX timestamp as float.\n",
      "     |  \n",
      "     |  timetuple(...)\n",
      "     |      Return time tuple, compatible with time.localtime().\n",
      "     |  \n",
      "     |  timetz(...)\n",
      "     |      Return time object with same time and tzinfo.\n",
      "     |  \n",
      "     |  tzname(...)\n",
      "     |      Return self.tzinfo.tzname(self).\n",
      "     |  \n",
      "     |  utcoffset(...)\n",
      "     |      Return self.tzinfo.utcoffset(self).\n",
      "     |  \n",
      "     |  utctimetuple(...)\n",
      "     |      Return UTC time tuple, compatible with time.localtime().\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods defined here:\n",
      "     |  \n",
      "     |  combine(...) from builtins.type\n",
      "     |      date, time -> datetime with same date and time fields\n",
      "     |  \n",
      "     |  fromisoformat(...) from builtins.type\n",
      "     |      string -> datetime from datetime.isoformat() output\n",
      "     |  \n",
      "     |  fromtimestamp(...) from builtins.type\n",
      "     |      timestamp[, tz] -> tz's local time from POSIX timestamp.\n",
      "     |  \n",
      "     |  now(tz=None) from builtins.type\n",
      "     |      Returns new datetime object representing current time local to tz.\n",
      "     |      \n",
      "     |        tz\n",
      "     |          Timezone object.\n",
      "     |      \n",
      "     |      If no tz is specified, uses local timezone.\n",
      "     |  \n",
      "     |  strptime(...) from builtins.type\n",
      "     |      string, format -> new datetime parsed from a string (like time.strptime()).\n",
      "     |  \n",
      "     |  utcfromtimestamp(...) from builtins.type\n",
      "     |      Construct a naive UTC datetime from a POSIX timestamp.\n",
      "     |  \n",
      "     |  utcnow(...) from builtins.type\n",
      "     |      Return a new datetime representing UTC day and time.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  fold\n",
      "     |  \n",
      "     |  hour\n",
      "     |  \n",
      "     |  microsecond\n",
      "     |  \n",
      "     |  minute\n",
      "     |  \n",
      "     |  second\n",
      "     |  \n",
      "     |  tzinfo\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)\n",
      "     |  \n",
      "     |  min = datetime.datetime(1, 1, 1, 0, 0)\n",
      "     |  \n",
      "     |  resolution = datetime.timedelta(microseconds=1)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from date:\n",
      "     |  \n",
      "     |  __format__(...)\n",
      "     |      Formats self with strftime.\n",
      "     |  \n",
      "     |  isocalendar(...)\n",
      "     |      Return a 3-tuple containing ISO year, week number, and weekday.\n",
      "     |  \n",
      "     |  isoweekday(...)\n",
      "     |      Return the day of the week represented by the date.\n",
      "     |      Monday == 1 ... Sunday == 7\n",
      "     |  \n",
      "     |  strftime(...)\n",
      "     |      format -> strftime() style string.\n",
      "     |  \n",
      "     |  toordinal(...)\n",
      "     |      Return proleptic Gregorian ordinal.  January 1 of year 1 is day 1.\n",
      "     |  \n",
      "     |  weekday(...)\n",
      "     |      Return the day of the week represented by the date.\n",
      "     |      Monday == 0 ... Sunday == 6\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods inherited from date:\n",
      "     |  \n",
      "     |  fromisocalendar(...) from builtins.type\n",
      "     |      int, int, int -> Construct a date from the ISO year, week number and weekday.\n",
      "     |      \n",
      "     |      This is the inverse of the date.isocalendar() function\n",
      "     |  \n",
      "     |  fromordinal(...) from builtins.type\n",
      "     |      int -> date corresponding to a proleptic Gregorian ordinal.\n",
      "     |  \n",
      "     |  today(...) from builtins.type\n",
      "     |      Current date or datetime:  same as self.__class__.fromtimestamp(time.time()).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from date:\n",
      "     |  \n",
      "     |  day\n",
      "     |  \n",
      "     |  month\n",
      "     |  \n",
      "     |  year\n",
      "    \n",
      "    class time(builtins.object)\n",
      "     |  time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object\n",
      "     |  \n",
      "     |  All arguments are optional. tzinfo may be None, or an instance of\n",
      "     |  a tzinfo subclass. The remaining arguments may be ints.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __format__(...)\n",
      "     |      Formats self with strftime.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      __reduce__() -> (cls, state)\n",
      "     |  \n",
      "     |  __reduce_ex__(...)\n",
      "     |      __reduce_ex__(proto) -> (cls, state)\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  dst(...)\n",
      "     |      Return self.tzinfo.dst(self).\n",
      "     |  \n",
      "     |  isoformat(...)\n",
      "     |      Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n",
      "     |      \n",
      "     |      The optional argument timespec specifies the number of additional terms\n",
      "     |      of the time to include. Valid options are 'auto', 'hours', 'minutes',\n",
      "     |      'seconds', 'milliseconds' and 'microseconds'.\n",
      "     |  \n",
      "     |  replace(...)\n",
      "     |      Return time with new specified fields.\n",
      "     |  \n",
      "     |  strftime(...)\n",
      "     |      format -> strftime() style string.\n",
      "     |  \n",
      "     |  tzname(...)\n",
      "     |      Return self.tzinfo.tzname(self).\n",
      "     |  \n",
      "     |  utcoffset(...)\n",
      "     |      Return self.tzinfo.utcoffset(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods defined here:\n",
      "     |  \n",
      "     |  fromisoformat(...) from builtins.type\n",
      "     |      string -> time from time.isoformat() output\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  fold\n",
      "     |  \n",
      "     |  hour\n",
      "     |  \n",
      "     |  microsecond\n",
      "     |  \n",
      "     |  minute\n",
      "     |  \n",
      "     |  second\n",
      "     |  \n",
      "     |  tzinfo\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  max = datetime.time(23, 59, 59, 999999)\n",
      "     |  \n",
      "     |  min = datetime.time(0, 0)\n",
      "     |  \n",
      "     |  resolution = datetime.timedelta(microseconds=1)\n",
      "    \n",
      "    class timedelta(builtins.object)\n",
      "     |  Difference between two datetime values.\n",
      "     |  \n",
      "     |  timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)\n",
      "     |  \n",
      "     |  All arguments are optional and default to 0.\n",
      "     |  Arguments may be integers or floats, and may be positive or negative.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __abs__(self, /)\n",
      "     |      abs(self)\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __bool__(self, /)\n",
      "     |      self != 0\n",
      "     |  \n",
      "     |  __divmod__(self, value, /)\n",
      "     |      Return divmod(self, value).\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __floordiv__(self, value, /)\n",
      "     |      Return self//value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mod__(self, value, /)\n",
      "     |      Return self%value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __neg__(self, /)\n",
      "     |      -self\n",
      "     |  \n",
      "     |  __pos__(self, /)\n",
      "     |      +self\n",
      "     |  \n",
      "     |  __radd__(self, value, /)\n",
      "     |      Return value+self.\n",
      "     |  \n",
      "     |  __rdivmod__(self, value, /)\n",
      "     |      Return divmod(value, self).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      __reduce__() -> (cls, state)\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __rfloordiv__(self, value, /)\n",
      "     |      Return value//self.\n",
      "     |  \n",
      "     |  __rmod__(self, value, /)\n",
      "     |      Return value%self.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  __rsub__(self, value, /)\n",
      "     |      Return value-self.\n",
      "     |  \n",
      "     |  __rtruediv__(self, value, /)\n",
      "     |      Return value/self.\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  __sub__(self, value, /)\n",
      "     |      Return self-value.\n",
      "     |  \n",
      "     |  __truediv__(self, value, /)\n",
      "     |      Return self/value.\n",
      "     |  \n",
      "     |  total_seconds(...)\n",
      "     |      Total seconds in the duration.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  days\n",
      "     |      Number of days.\n",
      "     |  \n",
      "     |  microseconds\n",
      "     |      Number of microseconds (>= 0 and less than 1 second).\n",
      "     |  \n",
      "     |  seconds\n",
      "     |      Number of seconds (>= 0 and less than 1 day).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  max = datetime.timedelta(days=999999999, seconds=86399, microseconds=9...\n",
      "     |  \n",
      "     |  min = datetime.timedelta(days=-999999999)\n",
      "     |  \n",
      "     |  resolution = datetime.timedelta(microseconds=1)\n",
      "    \n",
      "    class timezone(tzinfo)\n",
      "     |  Fixed offset from UTC implementation of tzinfo.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      timezone\n",
      "     |      tzinfo\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getinitargs__(...)\n",
      "     |      pickle support\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  dst(...)\n",
      "     |      Return None.\n",
      "     |  \n",
      "     |  fromutc(...)\n",
      "     |      datetime in UTC -> datetime in local time.\n",
      "     |  \n",
      "     |  tzname(...)\n",
      "     |      If name is specified when timezone is created, returns the name.  Otherwise returns offset as 'UTC(+|-)HH:MM'.\n",
      "     |  \n",
      "     |  utcoffset(...)\n",
      "     |      Return fixed offset.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  max = datetime.timezone(datetime.timedelta(seconds=86340))\n",
      "     |  \n",
      "     |  min = datetime.timezone(datetime.timedelta(days=-1, seconds=60))\n",
      "     |  \n",
      "     |  utc = datetime.timezone.utc\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from tzinfo:\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      -> (cls, state)\n",
      "    \n",
      "    class tzinfo(builtins.object)\n",
      "     |  Abstract base class for time zone info objects.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      -> (cls, state)\n",
      "     |  \n",
      "     |  dst(...)\n",
      "     |      datetime -> DST offset as timedelta positive east of UTC.\n",
      "     |  \n",
      "     |  fromutc(...)\n",
      "     |      datetime in UTC -> datetime in local time.\n",
      "     |  \n",
      "     |  tzname(...)\n",
      "     |      datetime -> string name of time zone.\n",
      "     |  \n",
      "     |  utcoffset(...)\n",
      "     |      datetime -> timedelta showing offset from UTC, negative values indicating West of UTC\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "\n",
      "DATA\n",
      "    MAXYEAR = 9999\n",
      "    MINYEAR = 1\n",
      "    datetime_CAPI = <capsule object \"datetime.datetime_CAPI\">\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\datetime.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "help(datetime)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "70c7461e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "28"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " datetime.date.today().day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "3db3373b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in module time:\n",
      "\n",
      "NAME\n",
      "    time - This module provides various functions to manipulate time values.\n",
      "\n",
      "DESCRIPTION\n",
      "    There are two standard representations of time.  One is the number\n",
      "    of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer\n",
      "    or a floating point number (to represent fractions of seconds).\n",
      "    The Epoch is system-defined; on Unix, it is generally January 1st, 1970.\n",
      "    The actual value can be retrieved by calling gmtime(0).\n",
      "    \n",
      "    The other representation is a tuple of 9 integers giving local time.\n",
      "    The tuple items are:\n",
      "      year (including century, e.g. 1998)\n",
      "      month (1-12)\n",
      "      day (1-31)\n",
      "      hours (0-23)\n",
      "      minutes (0-59)\n",
      "      seconds (0-59)\n",
      "      weekday (0-6, Monday is 0)\n",
      "      Julian day (day in the year, 1-366)\n",
      "      DST (Daylight Savings Time) flag (-1, 0 or 1)\n",
      "    If the DST flag is 0, the time is given in the regular time zone;\n",
      "    if it is 1, the time is given in the DST time zone;\n",
      "    if it is -1, mktime() should guess based on the date and time.\n",
      "\n",
      "CLASSES\n",
      "    builtins.tuple(builtins.object)\n",
      "        struct_time\n",
      "    \n",
      "    class struct_time(builtins.tuple)\n",
      "     |  struct_time(iterable=(), /)\n",
      "     |  \n",
      "     |  The time value as returned by gmtime(), localtime(), and strptime(), and\n",
      "     |  accepted by asctime(), mktime() and strftime().  May be considered as a\n",
      "     |  sequence of 9 integers.\n",
      "     |  \n",
      "     |  Note that several fields' values are not the same as those defined by\n",
      "     |  the C language standard for struct tm.  For example, the value of the\n",
      "     |  field tm_year is the actual year, not year - 1900.  See individual\n",
      "     |  fields' descriptions for details.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      struct_time\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  tm_gmtoff\n",
      "     |      offset from UTC in seconds\n",
      "     |  \n",
      "     |  tm_hour\n",
      "     |      hours, range [0, 23]\n",
      "     |  \n",
      "     |  tm_isdst\n",
      "     |      1 if summer time is in effect, 0 if not, and -1 if unknown\n",
      "     |  \n",
      "     |  tm_mday\n",
      "     |      day of month, range [1, 31]\n",
      "     |  \n",
      "     |  tm_min\n",
      "     |      minutes, range [0, 59]\n",
      "     |  \n",
      "     |  tm_mon\n",
      "     |      month of year, range [1, 12]\n",
      "     |  \n",
      "     |  tm_sec\n",
      "     |      seconds, range [0, 61])\n",
      "     |  \n",
      "     |  tm_wday\n",
      "     |      day of week, range [0, 6], Monday is 0\n",
      "     |  \n",
      "     |  tm_yday\n",
      "     |      day of year, range [1, 366]\n",
      "     |  \n",
      "     |  tm_year\n",
      "     |      year, for example, 1993\n",
      "     |  \n",
      "     |  tm_zone\n",
      "     |      abbreviation of timezone name\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 11\n",
      "     |  \n",
      "     |  n_sequence_fields = 9\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "\n",
      "FUNCTIONS\n",
      "    asctime(...)\n",
      "        asctime([tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.\n",
      "        When the time tuple is not present, current time as returned by localtime()\n",
      "        is used.\n",
      "    \n",
      "    ctime(...)\n",
      "        ctime(seconds) -> string\n",
      "        \n",
      "        Convert a time in seconds since the Epoch to a string in local time.\n",
      "        This is equivalent to asctime(localtime(seconds)). When the time tuple is\n",
      "        not present, current time as returned by localtime() is used.\n",
      "    \n",
      "    get_clock_info(...)\n",
      "        get_clock_info(name: str) -> dict\n",
      "        \n",
      "        Get information of the specified clock.\n",
      "    \n",
      "    gmtime(...)\n",
      "        gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n",
      "                               tm_sec, tm_wday, tm_yday, tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.\n",
      "        GMT).  When 'seconds' is not passed in, convert the current time instead.\n",
      "        \n",
      "        If the platform supports the tm_gmtoff and tm_zone, they are available as\n",
      "        attributes only.\n",
      "    \n",
      "    localtime(...)\n",
      "        localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n",
      "                                  tm_sec,tm_wday,tm_yday,tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing local time.\n",
      "        When 'seconds' is not passed in, convert the current time instead.\n",
      "    \n",
      "    mktime(...)\n",
      "        mktime(tuple) -> floating point number\n",
      "        \n",
      "        Convert a time tuple in local time to seconds since the Epoch.\n",
      "        Note that mktime(gmtime(0)) will not generally return zero for most\n",
      "        time zones; instead the returned value will either be equal to that\n",
      "        of the timezone or altzone attributes on the time module.\n",
      "    \n",
      "    monotonic(...)\n",
      "        monotonic() -> float\n",
      "        \n",
      "        Monotonic clock, cannot go backward.\n",
      "    \n",
      "    monotonic_ns(...)\n",
      "        monotonic_ns() -> int\n",
      "        \n",
      "        Monotonic clock, cannot go backward, as nanoseconds.\n",
      "    \n",
      "    perf_counter(...)\n",
      "        perf_counter() -> float\n",
      "        \n",
      "        Performance counter for benchmarking.\n",
      "    \n",
      "    perf_counter_ns(...)\n",
      "        perf_counter_ns() -> int\n",
      "        \n",
      "        Performance counter for benchmarking as nanoseconds.\n",
      "    \n",
      "    process_time(...)\n",
      "        process_time() -> float\n",
      "        \n",
      "        Process time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    process_time_ns(...)\n",
      "        process_time() -> int\n",
      "        \n",
      "        Process time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    sleep(...)\n",
      "        sleep(seconds)\n",
      "        \n",
      "        Delay execution for a given number of seconds.  The argument may be\n",
      "        a floating point number for subsecond precision.\n",
      "    \n",
      "    strftime(...)\n",
      "        strftime(format[, tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string according to a format specification.\n",
      "        See the library reference manual for formatting codes. When the time tuple\n",
      "        is not present, current time as returned by localtime() is used.\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    strptime(...)\n",
      "        strptime(string, format) -> struct_time\n",
      "        \n",
      "        Parse a string to a time tuple according to a format specification.\n",
      "        See the library reference manual for formatting codes (same as\n",
      "        strftime()).\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    thread_time(...)\n",
      "        thread_time() -> float\n",
      "        \n",
      "        Thread time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    thread_time_ns(...)\n",
      "        thread_time() -> int\n",
      "        \n",
      "        Thread time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    time(...)\n",
      "        time() -> floating point number\n",
      "        \n",
      "        Return the current time in seconds since the Epoch.\n",
      "        Fractions of a second may be present if the system clock provides them.\n",
      "    \n",
      "    time_ns(...)\n",
      "        time_ns() -> int\n",
      "        \n",
      "        Return the current time in nanoseconds since the Epoch.\n",
      "\n",
      "DATA\n",
      "    altzone = -32400\n",
      "    daylight = 0\n",
      "    timezone = -28800\n",
      "    tzname = ('中国标准时间', '中国夏令时')\n",
      "\n",
      "FILE\n",
      "    (built-in)\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import time\n",
    "help(time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "05bbb0b7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'16:51'"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.strftime(\"%H:%M\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7341b443",
   "metadata": {},
   "source": [
    "#### 7. zlib 数据压缩"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "2c7d8f50",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in module zlib:\n",
      "\n",
      "NAME\n",
      "    zlib\n",
      "\n",
      "DESCRIPTION\n",
      "    The functions in this module allow compression and decompression using the\n",
      "    zlib library, which is based on GNU zip.\n",
      "    \n",
      "    adler32(string[, start]) -- Compute an Adler-32 checksum.\n",
      "    compress(data[, level]) -- Compress data, with compression level 0-9 or -1.\n",
      "    compressobj([level[, ...]]) -- Return a compressor object.\n",
      "    crc32(string[, start]) -- Compute a CRC-32 checksum.\n",
      "    decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n",
      "    decompressobj([wbits[, zdict]]]) -- Return a decompressor object.\n",
      "    \n",
      "    'wbits' is window buffer size and container format.\n",
      "    Compressor objects support compress() and flush() methods; decompressor\n",
      "    objects support decompress() and flush().\n",
      "\n",
      "CLASSES\n",
      "    builtins.Exception(builtins.BaseException)\n",
      "        error\n",
      "    \n",
      "    class error(builtins.Exception)\n",
      "     |  Common base class for all non-exit exceptions.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      error\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.Exception:\n",
      "     |  \n",
      "     |  __init__(self, /, *args, **kwargs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.Exception:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "\n",
      "FUNCTIONS\n",
      "    adler32(data, value=1, /)\n",
      "        Compute an Adler-32 checksum of data.\n",
      "        \n",
      "          value\n",
      "            Starting value of the checksum.\n",
      "        \n",
      "        The returned checksum is an integer.\n",
      "    \n",
      "    compress(data, /, level=-1)\n",
      "        Returns a bytes object containing compressed data.\n",
      "        \n",
      "        data\n",
      "          Binary data to be compressed.\n",
      "        level\n",
      "          Compression level, in 0-9 or -1.\n",
      "    \n",
      "    compressobj(level=-1, method=8, wbits=15, memLevel=8, strategy=0, zdict=None)\n",
      "        Return a compressor object.\n",
      "        \n",
      "        level\n",
      "          The compression level (an integer in the range 0-9 or -1; default is\n",
      "          currently equivalent to 6).  Higher compression levels are slower,\n",
      "          but produce smaller results.\n",
      "        method\n",
      "          The compression algorithm.  If given, this must be DEFLATED.\n",
      "        wbits\n",
      "          +9 to +15: The base-two logarithm of the window size.  Include a zlib\n",
      "              container.\n",
      "          -9 to -15: Generate a raw stream.\n",
      "          +25 to +31: Include a gzip container.\n",
      "        memLevel\n",
      "          Controls the amount of memory used for internal compression state.\n",
      "          Valid values range from 1 to 9.  Higher values result in higher memory\n",
      "          usage, faster compression, and smaller output.\n",
      "        strategy\n",
      "          Used to tune the compression algorithm.  Possible values are\n",
      "          Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.\n",
      "        zdict\n",
      "          The predefined compression dictionary - a sequence of bytes\n",
      "          containing subsequences that are likely to occur in the input data.\n",
      "    \n",
      "    crc32(data, value=0, /)\n",
      "        Compute a CRC-32 checksum of data.\n",
      "        \n",
      "          value\n",
      "            Starting value of the checksum.\n",
      "        \n",
      "        The returned checksum is an integer.\n",
      "    \n",
      "    decompress(data, /, wbits=15, bufsize=16384)\n",
      "        Returns a bytes object containing the uncompressed data.\n",
      "        \n",
      "        data\n",
      "          Compressed data.\n",
      "        wbits\n",
      "          The window buffer size and container format.\n",
      "        bufsize\n",
      "          The initial output buffer size.\n",
      "    \n",
      "    decompressobj(wbits=15, zdict=b'')\n",
      "        Return a decompressor object.\n",
      "        \n",
      "        wbits\n",
      "          The window buffer size and container format.\n",
      "        zdict\n",
      "          The predefined compression dictionary.  This must be the same\n",
      "          dictionary as used by the compressor that produced the input data.\n",
      "\n",
      "DATA\n",
      "    DEFLATED = 8\n",
      "    DEF_BUF_SIZE = 16384\n",
      "    DEF_MEM_LEVEL = 8\n",
      "    MAX_WBITS = 15\n",
      "    ZLIB_RUNTIME_VERSION = '1.2.11'\n",
      "    ZLIB_VERSION = '1.2.11'\n",
      "    Z_BEST_COMPRESSION = 9\n",
      "    Z_BEST_SPEED = 1\n",
      "    Z_BLOCK = 5\n",
      "    Z_DEFAULT_COMPRESSION = -1\n",
      "    Z_DEFAULT_STRATEGY = 0\n",
      "    Z_FILTERED = 1\n",
      "    Z_FINISH = 4\n",
      "    Z_FIXED = 4\n",
      "    Z_FULL_FLUSH = 3\n",
      "    Z_HUFFMAN_ONLY = 2\n",
      "    Z_NO_COMPRESSION = 0\n",
      "    Z_NO_FLUSH = 0\n",
      "    Z_PARTIAL_FLUSH = 1\n",
      "    Z_RLE = 3\n",
      "    Z_SYNC_FLUSH = 2\n",
      "    Z_TREES = 6\n",
      "\n",
      "VERSION\n",
      "    1.0\n",
      "\n",
      "FILE\n",
      "    (built-in)\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import zlib\n",
    "help(zlib)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5fd45a40",
   "metadata": {},
   "source": [
    "#### 8. doctest 测试模块\n",
    "* 提供了一个工具，扫描模块并根据程序中内嵌的文档字符串执行测试"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "40089796",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on module doctest:\n",
      "\n",
      "NAME\n",
      "    doctest - Module doctest -- a framework for running examples in docstrings.\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/doctest\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "DESCRIPTION\n",
      "    In simplest use, end each module M to be tested with:\n",
      "    \n",
      "    def _test():\n",
      "        import doctest\n",
      "        doctest.testmod()\n",
      "    \n",
      "    if __name__ == \"__main__\":\n",
      "        _test()\n",
      "    \n",
      "    Then running the module as a script will cause the examples in the\n",
      "    docstrings to get executed and verified:\n",
      "    \n",
      "    python M.py\n",
      "    \n",
      "    This won't display anything unless an example fails, in which case the\n",
      "    failing example(s) and the cause(s) of the failure(s) are printed to stdout\n",
      "    (why not stderr? because stderr is a lame hack <0.2 wink>), and the final\n",
      "    line of output is \"Test failed.\".\n",
      "    \n",
      "    Run it with the -v switch instead:\n",
      "    \n",
      "    python M.py -v\n",
      "    \n",
      "    and a detailed report of all examples tried is printed to stdout, along\n",
      "    with assorted summaries at the end.\n",
      "    \n",
      "    You can force verbose mode by passing \"verbose=True\" to testmod, or prohibit\n",
      "    it by passing \"verbose=False\".  In either of those cases, sys.argv is not\n",
      "    examined by testmod.\n",
      "    \n",
      "    There are a variety of other ways to run doctests, including integration\n",
      "    with the unittest framework, and support for running non-Python text\n",
      "    files containing doctests.  There are also many ways to override parts\n",
      "    of doctest's default behaviors.  See the Library Reference Manual for\n",
      "    details.\n",
      "\n",
      "CLASSES\n",
      "    builtins.Exception(builtins.BaseException)\n",
      "        DocTestFailure\n",
      "        UnexpectedException\n",
      "    builtins.object\n",
      "        DocTest\n",
      "        DocTestFinder\n",
      "        DocTestParser\n",
      "        DocTestRunner\n",
      "            DebugRunner\n",
      "        Example\n",
      "        OutputChecker\n",
      "    \n",
      "    class DebugRunner(DocTestRunner)\n",
      "     |  DebugRunner(checker=None, verbose=None, optionflags=0)\n",
      "     |  \n",
      "     |  Run doc tests but raise an exception as soon as there is a failure.\n",
      "     |  \n",
      "     |  If an unexpected exception occurs, an UnexpectedException is raised.\n",
      "     |  It contains the test, the example, and the original exception:\n",
      "     |  \n",
      "     |    >>> runner = DebugRunner(verbose=False)\n",
      "     |    >>> test = DocTestParser().get_doctest('>>> raise KeyError\\n42',\n",
      "     |    ...                                    {}, 'foo', 'foo.py', 0)\n",
      "     |    >>> try:\n",
      "     |    ...     runner.run(test)\n",
      "     |    ... except UnexpectedException as f:\n",
      "     |    ...     failure = f\n",
      "     |  \n",
      "     |    >>> failure.test is test\n",
      "     |    True\n",
      "     |  \n",
      "     |    >>> failure.example.want\n",
      "     |    '42\\n'\n",
      "     |  \n",
      "     |    >>> exc_info = failure.exc_info\n",
      "     |    >>> raise exc_info[1] # Already has the traceback\n",
      "     |    Traceback (most recent call last):\n",
      "     |    ...\n",
      "     |    KeyError\n",
      "     |  \n",
      "     |  We wrap the original exception to give the calling application\n",
      "     |  access to the test and example information.\n",
      "     |  \n",
      "     |  If the output doesn't match, then a DocTestFailure is raised:\n",
      "     |  \n",
      "     |    >>> test = DocTestParser().get_doctest('''\n",
      "     |    ...      >>> x = 1\n",
      "     |    ...      >>> x\n",
      "     |    ...      2\n",
      "     |    ...      ''', {}, 'foo', 'foo.py', 0)\n",
      "     |  \n",
      "     |    >>> try:\n",
      "     |    ...    runner.run(test)\n",
      "     |    ... except DocTestFailure as f:\n",
      "     |    ...    failure = f\n",
      "     |  \n",
      "     |  DocTestFailure objects provide access to the test:\n",
      "     |  \n",
      "     |    >>> failure.test is test\n",
      "     |    True\n",
      "     |  \n",
      "     |  As well as to the example:\n",
      "     |  \n",
      "     |    >>> failure.example.want\n",
      "     |    '2\\n'\n",
      "     |  \n",
      "     |  and the actual output:\n",
      "     |  \n",
      "     |    >>> failure.got\n",
      "     |    '1\\n'\n",
      "     |  \n",
      "     |  If a failure or error occurs, the globals are left intact:\n",
      "     |  \n",
      "     |    >>> del test.globs['__builtins__']\n",
      "     |    >>> test.globs\n",
      "     |    {'x': 1}\n",
      "     |  \n",
      "     |    >>> test = DocTestParser().get_doctest('''\n",
      "     |    ...      >>> x = 2\n",
      "     |    ...      >>> raise KeyError\n",
      "     |    ...      ''', {}, 'foo', 'foo.py', 0)\n",
      "     |  \n",
      "     |    >>> runner.run(test)\n",
      "     |    Traceback (most recent call last):\n",
      "     |    ...\n",
      "     |    doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>\n",
      "     |  \n",
      "     |    >>> del test.globs['__builtins__']\n",
      "     |    >>> test.globs\n",
      "     |    {'x': 2}\n",
      "     |  \n",
      "     |  But the globals are cleared if there is no error:\n",
      "     |  \n",
      "     |    >>> test = DocTestParser().get_doctest('''\n",
      "     |    ...      >>> x = 2\n",
      "     |    ...      ''', {}, 'foo', 'foo.py', 0)\n",
      "     |  \n",
      "     |    >>> runner.run(test)\n",
      "     |    TestResults(failed=0, attempted=1)\n",
      "     |  \n",
      "     |    >>> test.globs\n",
      "     |    {}\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      DebugRunner\n",
      "     |      DocTestRunner\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  report_failure(self, out, test, example, got)\n",
      "     |      Report that the given example failed.\n",
      "     |  \n",
      "     |  report_unexpected_exception(self, out, test, example, exc_info)\n",
      "     |      Report that the given example raised an unexpected exception.\n",
      "     |  \n",
      "     |  run(self, test, compileflags=None, out=None, clear_globs=True)\n",
      "     |      Run the examples in `test`, and display the results using the\n",
      "     |      writer function `out`.\n",
      "     |      \n",
      "     |      The examples are run in the namespace `test.globs`.  If\n",
      "     |      `clear_globs` is true (the default), then this namespace will\n",
      "     |      be cleared after the test runs, to help with garbage\n",
      "     |      collection.  If you would like to examine the namespace after\n",
      "     |      the test completes, then use `clear_globs=False`.\n",
      "     |      \n",
      "     |      `compileflags` gives the set of flags that should be used by\n",
      "     |      the Python compiler when running the examples.  If not\n",
      "     |      specified, then it will default to the set of future-import\n",
      "     |      flags that apply to `globs`.\n",
      "     |      \n",
      "     |      The output of each example is checked using\n",
      "     |      `DocTestRunner.check_output`, and the results are formatted by\n",
      "     |      the `DocTestRunner.report_*` methods.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from DocTestRunner:\n",
      "     |  \n",
      "     |  __init__(self, checker=None, verbose=None, optionflags=0)\n",
      "     |      Create a new test runner.\n",
      "     |      \n",
      "     |      Optional keyword arg `checker` is the `OutputChecker` that\n",
      "     |      should be used to compare the expected outputs and actual\n",
      "     |      outputs of doctest examples.\n",
      "     |      \n",
      "     |      Optional keyword arg 'verbose' prints lots of stuff if true,\n",
      "     |      only failures if false; by default, it's true iff '-v' is in\n",
      "     |      sys.argv.\n",
      "     |      \n",
      "     |      Optional argument `optionflags` can be used to control how the\n",
      "     |      test runner compares expected output to actual output, and how\n",
      "     |      it displays failures.  See the documentation for `testmod` for\n",
      "     |      more information.\n",
      "     |  \n",
      "     |  merge(self, other)\n",
      "     |      #/////////////////////////////////////////////////////////////////\n",
      "     |      # Backward compatibility cruft to maintain doctest.master.\n",
      "     |      #/////////////////////////////////////////////////////////////////\n",
      "     |  \n",
      "     |  report_start(self, out, test, example)\n",
      "     |      Report that the test runner is about to process the given\n",
      "     |      example.  (Only displays a message if verbose=True)\n",
      "     |  \n",
      "     |  report_success(self, out, test, example, got)\n",
      "     |      Report that the given example ran successfully.  (Only\n",
      "     |      displays a message if verbose=True)\n",
      "     |  \n",
      "     |  summarize(self, verbose=None)\n",
      "     |      Print a summary of all the test cases that have been run by\n",
      "     |      this DocTestRunner, and return a tuple `(f, t)`, where `f` is\n",
      "     |      the total number of failed examples, and `t` is the total\n",
      "     |      number of tried examples.\n",
      "     |      \n",
      "     |      The optional `verbose` argument controls how detailed the\n",
      "     |      summary is.  If the verbosity is not specified, then the\n",
      "     |      DocTestRunner's verbosity is used.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from DocTestRunner:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from DocTestRunner:\n",
      "     |  \n",
      "     |  DIVIDER = '***********************************************************...\n",
      "    \n",
      "    class DocTest(builtins.object)\n",
      "     |  DocTest(examples, globs, name, filename, lineno, docstring)\n",
      "     |  \n",
      "     |  A collection of doctest examples that should be run in a single\n",
      "     |  namespace.  Each `DocTest` defines the following attributes:\n",
      "     |  \n",
      "     |    - examples: the list of examples.\n",
      "     |  \n",
      "     |    - globs: The namespace (aka globals) that the examples should\n",
      "     |      be run in.\n",
      "     |  \n",
      "     |    - name: A name identifying the DocTest (typically, the name of\n",
      "     |      the object whose docstring this DocTest was extracted from).\n",
      "     |  \n",
      "     |    - filename: The name of the file that this DocTest was extracted\n",
      "     |      from, or `None` if the filename is unknown.\n",
      "     |  \n",
      "     |    - lineno: The line number within filename where this DocTest\n",
      "     |      begins, or `None` if the line number is unavailable.  This\n",
      "     |      line number is zero-based, with respect to the beginning of\n",
      "     |      the file.\n",
      "     |  \n",
      "     |    - docstring: The string that the examples were extracted from,\n",
      "     |      or `None` if the string is unavailable.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self, examples, globs, name, filename, lineno, docstring)\n",
      "     |      Create a new DocTest containing the given examples.  The\n",
      "     |      DocTest's globals are initialized with a copy of `globs`.\n",
      "     |  \n",
      "     |  __lt__(self, other)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class DocTestFailure(builtins.Exception)\n",
      "     |  DocTestFailure(test, example, got)\n",
      "     |  \n",
      "     |  A DocTest example has failed in debugging mode.\n",
      "     |  \n",
      "     |  The exception instance has variables:\n",
      "     |  \n",
      "     |  - test: the DocTest object being run\n",
      "     |  \n",
      "     |  - example: the Example object that failed\n",
      "     |  \n",
      "     |  - got: the actual output\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      DocTestFailure\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, test, example, got)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.Exception:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "    \n",
      "    class DocTestFinder(builtins.object)\n",
      "     |  DocTestFinder(verbose=False, parser=<doctest.DocTestParser object at 0x000001FAF6D0DDC0>, recurse=True, exclude_empty=True)\n",
      "     |  \n",
      "     |  A class used to extract the DocTests that are relevant to a given\n",
      "     |  object, from its docstring and the docstrings of its contained\n",
      "     |  objects.  Doctests can currently be extracted from the following\n",
      "     |  object types: modules, functions, classes, methods, staticmethods,\n",
      "     |  classmethods, and properties.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, verbose=False, parser=<doctest.DocTestParser object at 0x000001FAF6D0DDC0>, recurse=True, exclude_empty=True)\n",
      "     |      Create a new doctest finder.\n",
      "     |      \n",
      "     |      The optional argument `parser` specifies a class or\n",
      "     |      function that should be used to create new DocTest objects (or\n",
      "     |      objects that implement the same interface as DocTest).  The\n",
      "     |      signature for this factory function should match the signature\n",
      "     |      of the DocTest constructor.\n",
      "     |      \n",
      "     |      If the optional argument `recurse` is false, then `find` will\n",
      "     |      only examine the given object, and not any contained objects.\n",
      "     |      \n",
      "     |      If the optional argument `exclude_empty` is false, then `find`\n",
      "     |      will include tests for objects with empty docstrings.\n",
      "     |  \n",
      "     |  find(self, obj, name=None, module=None, globs=None, extraglobs=None)\n",
      "     |      Return a list of the DocTests that are defined by the given\n",
      "     |      object's docstring, or by any of its contained objects'\n",
      "     |      docstrings.\n",
      "     |      \n",
      "     |      The optional parameter `module` is the module that contains\n",
      "     |      the given object.  If the module is not specified or is None, then\n",
      "     |      the test finder will attempt to automatically determine the\n",
      "     |      correct module.  The object's module is used:\n",
      "     |      \n",
      "     |          - As a default namespace, if `globs` is not specified.\n",
      "     |          - To prevent the DocTestFinder from extracting DocTests\n",
      "     |            from objects that are imported from other modules.\n",
      "     |          - To find the name of the file containing the object.\n",
      "     |          - To help find the line number of the object within its\n",
      "     |            file.\n",
      "     |      \n",
      "     |      Contained objects whose module does not match `module` are ignored.\n",
      "     |      \n",
      "     |      If `module` is False, no attempt to find the module will be made.\n",
      "     |      This is obscure, of use mostly in tests:  if `module` is False, or\n",
      "     |      is None but cannot be found automatically, then all objects are\n",
      "     |      considered to belong to the (non-existent) module, so all contained\n",
      "     |      objects will (recursively) be searched for doctests.\n",
      "     |      \n",
      "     |      The globals for each DocTest is formed by combining `globs`\n",
      "     |      and `extraglobs` (bindings in `extraglobs` override bindings\n",
      "     |      in `globs`).  A new copy of the globals dictionary is created\n",
      "     |      for each DocTest.  If `globs` is not specified, then it\n",
      "     |      defaults to the module's `__dict__`, if specified, or {}\n",
      "     |      otherwise.  If `extraglobs` is not specified, then it defaults\n",
      "     |      to {}.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class DocTestParser(builtins.object)\n",
      "     |  A class used to parse strings containing doctest examples.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  get_doctest(self, string, globs, name, filename, lineno)\n",
      "     |      Extract all doctest examples from the given string, and\n",
      "     |      collect them into a `DocTest` object.\n",
      "     |      \n",
      "     |      `globs`, `name`, `filename`, and `lineno` are attributes for\n",
      "     |      the new `DocTest` object.  See the documentation for `DocTest`\n",
      "     |      for more information.\n",
      "     |  \n",
      "     |  get_examples(self, string, name='<string>')\n",
      "     |      Extract all doctest examples from the given string, and return\n",
      "     |      them as a list of `Example` objects.  Line numbers are\n",
      "     |      0-based, because it's most common in doctests that nothing\n",
      "     |      interesting appears on the same line as opening triple-quote,\n",
      "     |      and so the first interesting line is called \"line 1\" then.\n",
      "     |      \n",
      "     |      The optional argument `name` is a name identifying this\n",
      "     |      string, and is only used for error messages.\n",
      "     |  \n",
      "     |  parse(self, string, name='<string>')\n",
      "     |      Divide the given string into examples and intervening text,\n",
      "     |      and return them as a list of alternating Examples and strings.\n",
      "     |      Line numbers for the Examples are 0-based.  The optional\n",
      "     |      argument `name` is a name identifying this string, and is only\n",
      "     |      used for error messages.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class DocTestRunner(builtins.object)\n",
      "     |  DocTestRunner(checker=None, verbose=None, optionflags=0)\n",
      "     |  \n",
      "     |  A class used to run DocTest test cases, and accumulate statistics.\n",
      "     |  The `run` method is used to process a single DocTest case.  It\n",
      "     |  returns a tuple `(f, t)`, where `t` is the number of test cases\n",
      "     |  tried, and `f` is the number of test cases that failed.\n",
      "     |  \n",
      "     |      >>> tests = DocTestFinder().find(_TestClass)\n",
      "     |      >>> runner = DocTestRunner(verbose=False)\n",
      "     |      >>> tests.sort(key = lambda test: test.name)\n",
      "     |      >>> for test in tests:\n",
      "     |      ...     print(test.name, '->', runner.run(test))\n",
      "     |      _TestClass -> TestResults(failed=0, attempted=2)\n",
      "     |      _TestClass.__init__ -> TestResults(failed=0, attempted=2)\n",
      "     |      _TestClass.get -> TestResults(failed=0, attempted=2)\n",
      "     |      _TestClass.square -> TestResults(failed=0, attempted=1)\n",
      "     |  \n",
      "     |  The `summarize` method prints a summary of all the test cases that\n",
      "     |  have been run by the runner, and returns an aggregated `(f, t)`\n",
      "     |  tuple:\n",
      "     |  \n",
      "     |      >>> runner.summarize(verbose=1)\n",
      "     |      4 items passed all tests:\n",
      "     |         2 tests in _TestClass\n",
      "     |         2 tests in _TestClass.__init__\n",
      "     |         2 tests in _TestClass.get\n",
      "     |         1 tests in _TestClass.square\n",
      "     |      7 tests in 4 items.\n",
      "     |      7 passed and 0 failed.\n",
      "     |      Test passed.\n",
      "     |      TestResults(failed=0, attempted=7)\n",
      "     |  \n",
      "     |  The aggregated number of tried examples and failed examples is\n",
      "     |  also available via the `tries` and `failures` attributes:\n",
      "     |  \n",
      "     |      >>> runner.tries\n",
      "     |      7\n",
      "     |      >>> runner.failures\n",
      "     |      0\n",
      "     |  \n",
      "     |  The comparison between expected outputs and actual outputs is done\n",
      "     |  by an `OutputChecker`.  This comparison may be customized with a\n",
      "     |  number of option flags; see the documentation for `testmod` for\n",
      "     |  more information.  If the option flags are insufficient, then the\n",
      "     |  comparison may also be customized by passing a subclass of\n",
      "     |  `OutputChecker` to the constructor.\n",
      "     |  \n",
      "     |  The test runner's display output can be controlled in two ways.\n",
      "     |  First, an output function (`out) can be passed to\n",
      "     |  `TestRunner.run`; this function will be called with strings that\n",
      "     |  should be displayed.  It defaults to `sys.stdout.write`.  If\n",
      "     |  capturing the output is not sufficient, then the display output\n",
      "     |  can be also customized by subclassing DocTestRunner, and\n",
      "     |  overriding the methods `report_start`, `report_success`,\n",
      "     |  `report_unexpected_exception`, and `report_failure`.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, checker=None, verbose=None, optionflags=0)\n",
      "     |      Create a new test runner.\n",
      "     |      \n",
      "     |      Optional keyword arg `checker` is the `OutputChecker` that\n",
      "     |      should be used to compare the expected outputs and actual\n",
      "     |      outputs of doctest examples.\n",
      "     |      \n",
      "     |      Optional keyword arg 'verbose' prints lots of stuff if true,\n",
      "     |      only failures if false; by default, it's true iff '-v' is in\n",
      "     |      sys.argv.\n",
      "     |      \n",
      "     |      Optional argument `optionflags` can be used to control how the\n",
      "     |      test runner compares expected output to actual output, and how\n",
      "     |      it displays failures.  See the documentation for `testmod` for\n",
      "     |      more information.\n",
      "     |  \n",
      "     |  merge(self, other)\n",
      "     |      #/////////////////////////////////////////////////////////////////\n",
      "     |      # Backward compatibility cruft to maintain doctest.master.\n",
      "     |      #/////////////////////////////////////////////////////////////////\n",
      "     |  \n",
      "     |  report_failure(self, out, test, example, got)\n",
      "     |      Report that the given example failed.\n",
      "     |  \n",
      "     |  report_start(self, out, test, example)\n",
      "     |      Report that the test runner is about to process the given\n",
      "     |      example.  (Only displays a message if verbose=True)\n",
      "     |  \n",
      "     |  report_success(self, out, test, example, got)\n",
      "     |      Report that the given example ran successfully.  (Only\n",
      "     |      displays a message if verbose=True)\n",
      "     |  \n",
      "     |  report_unexpected_exception(self, out, test, example, exc_info)\n",
      "     |      Report that the given example raised an unexpected exception.\n",
      "     |  \n",
      "     |  run(self, test, compileflags=None, out=None, clear_globs=True)\n",
      "     |      Run the examples in `test`, and display the results using the\n",
      "     |      writer function `out`.\n",
      "     |      \n",
      "     |      The examples are run in the namespace `test.globs`.  If\n",
      "     |      `clear_globs` is true (the default), then this namespace will\n",
      "     |      be cleared after the test runs, to help with garbage\n",
      "     |      collection.  If you would like to examine the namespace after\n",
      "     |      the test completes, then use `clear_globs=False`.\n",
      "     |      \n",
      "     |      `compileflags` gives the set of flags that should be used by\n",
      "     |      the Python compiler when running the examples.  If not\n",
      "     |      specified, then it will default to the set of future-import\n",
      "     |      flags that apply to `globs`.\n",
      "     |      \n",
      "     |      The output of each example is checked using\n",
      "     |      `DocTestRunner.check_output`, and the results are formatted by\n",
      "     |      the `DocTestRunner.report_*` methods.\n",
      "     |  \n",
      "     |  summarize(self, verbose=None)\n",
      "     |      Print a summary of all the test cases that have been run by\n",
      "     |      this DocTestRunner, and return a tuple `(f, t)`, where `f` is\n",
      "     |      the total number of failed examples, and `t` is the total\n",
      "     |      number of tried examples.\n",
      "     |      \n",
      "     |      The optional `verbose` argument controls how detailed the\n",
      "     |      summary is.  If the verbosity is not specified, then the\n",
      "     |      DocTestRunner's verbosity is used.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  DIVIDER = '***********************************************************...\n",
      "    \n",
      "    class Example(builtins.object)\n",
      "     |  Example(source, want, exc_msg=None, lineno=0, indent=0, options=None)\n",
      "     |  \n",
      "     |  A single doctest example, consisting of source code and expected\n",
      "     |  output.  `Example` defines the following attributes:\n",
      "     |  \n",
      "     |    - source: A single Python statement, always ending with a newline.\n",
      "     |      The constructor adds a newline if needed.\n",
      "     |  \n",
      "     |    - want: The expected output from running the source code (either\n",
      "     |      from stdout, or a traceback in case of exception).  `want` ends\n",
      "     |      with a newline unless it's empty, in which case it's an empty\n",
      "     |      string.  The constructor adds a newline if needed.\n",
      "     |  \n",
      "     |    - exc_msg: The exception message generated by the example, if\n",
      "     |      the example is expected to generate an exception; or `None` if\n",
      "     |      it is not expected to generate an exception.  This exception\n",
      "     |      message is compared against the return value of\n",
      "     |      `traceback.format_exception_only()`.  `exc_msg` ends with a\n",
      "     |      newline unless it's `None`.  The constructor adds a newline\n",
      "     |      if needed.\n",
      "     |  \n",
      "     |    - lineno: The line number within the DocTest string containing\n",
      "     |      this Example where the Example begins.  This line number is\n",
      "     |      zero-based, with respect to the beginning of the DocTest.\n",
      "     |  \n",
      "     |    - indent: The example's indentation in the DocTest string.\n",
      "     |      I.e., the number of space characters that precede the\n",
      "     |      example's first prompt.\n",
      "     |  \n",
      "     |    - options: A dictionary mapping from option flags to True or\n",
      "     |      False, which is used to override default options for this\n",
      "     |      example.  Any option flags not contained in this dictionary\n",
      "     |      are left at their default value (as specified by the\n",
      "     |      DocTestRunner's optionflags).  By default, no options are set.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self, source, want, exc_msg=None, lineno=0, indent=0, options=None)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class OutputChecker(builtins.object)\n",
      "     |  A class used to check the whether the actual output from a doctest\n",
      "     |  example matches the expected output.  `OutputChecker` defines two\n",
      "     |  methods: `check_output`, which compares a given pair of outputs,\n",
      "     |  and returns true if they match; and `output_difference`, which\n",
      "     |  returns a string describing the differences between two outputs.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  check_output(self, want, got, optionflags)\n",
      "     |      Return True iff the actual output from an example (`got`)\n",
      "     |      matches the expected output (`want`).  These strings are\n",
      "     |      always considered to match if they are identical; but\n",
      "     |      depending on what option flags the test runner is using,\n",
      "     |      several non-exact match types are also possible.  See the\n",
      "     |      documentation for `TestRunner` for more information about\n",
      "     |      option flags.\n",
      "     |  \n",
      "     |  output_difference(self, example, got, optionflags)\n",
      "     |      Return a string describing the differences between the\n",
      "     |      expected output for a given example (`example`) and the actual\n",
      "     |      output (`got`).  `optionflags` is the set of option flags used\n",
      "     |      to compare `want` and `got`.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class UnexpectedException(builtins.Exception)\n",
      "     |  UnexpectedException(test, example, exc_info)\n",
      "     |  \n",
      "     |  A DocTest example has encountered an unexpected exception\n",
      "     |  \n",
      "     |  The exception instance has variables:\n",
      "     |  \n",
      "     |  - test: the DocTest object being run\n",
      "     |  \n",
      "     |  - example: the Example object that failed\n",
      "     |  \n",
      "     |  - exc_info: the exception info\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      UnexpectedException\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, test, example, exc_info)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.Exception:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "\n",
      "FUNCTIONS\n",
      "    DocFileSuite(*paths, **kw)\n",
      "        A unittest suite for one or more doctest files.\n",
      "        \n",
      "        The path to each doctest file is given as a string; the\n",
      "        interpretation of that string depends on the keyword argument\n",
      "        \"module_relative\".\n",
      "        \n",
      "        A number of options may be provided as keyword arguments:\n",
      "        \n",
      "        module_relative\n",
      "          If \"module_relative\" is True, then the given file paths are\n",
      "          interpreted as os-independent module-relative paths.  By\n",
      "          default, these paths are relative to the calling module's\n",
      "          directory; but if the \"package\" argument is specified, then\n",
      "          they are relative to that package.  To ensure os-independence,\n",
      "          \"filename\" should use \"/\" characters to separate path\n",
      "          segments, and may not be an absolute path (i.e., it may not\n",
      "          begin with \"/\").\n",
      "        \n",
      "          If \"module_relative\" is False, then the given file paths are\n",
      "          interpreted as os-specific paths.  These paths may be absolute\n",
      "          or relative (to the current working directory).\n",
      "        \n",
      "        package\n",
      "          A Python package or the name of a Python package whose directory\n",
      "          should be used as the base directory for module relative paths.\n",
      "          If \"package\" is not specified, then the calling module's\n",
      "          directory is used as the base directory for module relative\n",
      "          filenames.  It is an error to specify \"package\" if\n",
      "          \"module_relative\" is False.\n",
      "        \n",
      "        setUp\n",
      "          A set-up function.  This is called before running the\n",
      "          tests in each file. The setUp function will be passed a DocTest\n",
      "          object.  The setUp function can access the test globals as the\n",
      "          globs attribute of the test passed.\n",
      "        \n",
      "        tearDown\n",
      "          A tear-down function.  This is called after running the\n",
      "          tests in each file.  The tearDown function will be passed a DocTest\n",
      "          object.  The tearDown function can access the test globals as the\n",
      "          globs attribute of the test passed.\n",
      "        \n",
      "        globs\n",
      "          A dictionary containing initial global variables for the tests.\n",
      "        \n",
      "        optionflags\n",
      "          A set of doctest option flags expressed as an integer.\n",
      "        \n",
      "        parser\n",
      "          A DocTestParser (or subclass) that should be used to extract\n",
      "          tests from the files.\n",
      "        \n",
      "        encoding\n",
      "          An encoding that will be used to convert the files to unicode.\n",
      "    \n",
      "    DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, **options)\n",
      "        Convert doctest tests for a module to a unittest test suite.\n",
      "        \n",
      "        This converts each documentation string in a module that\n",
      "        contains doctest tests to a unittest test case.  If any of the\n",
      "        tests in a doc string fail, then the test case fails.  An exception\n",
      "        is raised showing the name of the file containing the test and a\n",
      "        (sometimes approximate) line number.\n",
      "        \n",
      "        The `module` argument provides the module to be tested.  The argument\n",
      "        can be either a module or a module name.\n",
      "        \n",
      "        If no argument is given, the calling module is used.\n",
      "        \n",
      "        A number of options may be provided as keyword arguments:\n",
      "        \n",
      "        setUp\n",
      "          A set-up function.  This is called before running the\n",
      "          tests in each file. The setUp function will be passed a DocTest\n",
      "          object.  The setUp function can access the test globals as the\n",
      "          globs attribute of the test passed.\n",
      "        \n",
      "        tearDown\n",
      "          A tear-down function.  This is called after running the\n",
      "          tests in each file.  The tearDown function will be passed a DocTest\n",
      "          object.  The tearDown function can access the test globals as the\n",
      "          globs attribute of the test passed.\n",
      "        \n",
      "        globs\n",
      "          A dictionary containing initial global variables for the tests.\n",
      "        \n",
      "        optionflags\n",
      "           A set of doctest option flags expressed as an integer.\n",
      "    \n",
      "    debug(module, name, pm=False)\n",
      "        Debug a single doctest docstring.\n",
      "        \n",
      "        Provide the module (or dotted name of the module) containing the\n",
      "        test to be debugged and the name (within the module) of the object\n",
      "        with the docstring with tests to be debugged.\n",
      "    \n",
      "    debug_src(src, pm=False, globs=None)\n",
      "        Debug a single doctest docstring, in argument `src`'\n",
      "    \n",
      "    register_optionflag(name)\n",
      "    \n",
      "    run_docstring_examples(f, globs, verbose=False, name='NoName', compileflags=None, optionflags=0)\n",
      "        Test examples in the given object's docstring (`f`), using `globs`\n",
      "        as globals.  Optional argument `name` is used in failure messages.\n",
      "        If the optional argument `verbose` is true, then generate output\n",
      "        even if there are no failures.\n",
      "        \n",
      "        `compileflags` gives the set of flags that should be used by the\n",
      "        Python compiler when running the examples.  If not specified, then\n",
      "        it will default to the set of future-import flags that apply to\n",
      "        `globs`.\n",
      "        \n",
      "        Optional keyword arg `optionflags` specifies options for the\n",
      "        testing and output.  See the documentation for `testmod` for more\n",
      "        information.\n",
      "    \n",
      "    script_from_examples(s)\n",
      "        Extract script from text with examples.\n",
      "        \n",
      "        Converts text with examples to a Python script.  Example input is\n",
      "        converted to regular code.  Example output and all other words\n",
      "        are converted to comments:\n",
      "        \n",
      "        >>> text = '''\n",
      "        ...       Here are examples of simple math.\n",
      "        ...\n",
      "        ...           Python has super accurate integer addition\n",
      "        ...\n",
      "        ...           >>> 2 + 2\n",
      "        ...           5\n",
      "        ...\n",
      "        ...           And very friendly error messages:\n",
      "        ...\n",
      "        ...           >>> 1/0\n",
      "        ...           To Infinity\n",
      "        ...           And\n",
      "        ...           Beyond\n",
      "        ...\n",
      "        ...           You can use logic if you want:\n",
      "        ...\n",
      "        ...           >>> if 0:\n",
      "        ...           ...    blah\n",
      "        ...           ...    blah\n",
      "        ...           ...\n",
      "        ...\n",
      "        ...           Ho hum\n",
      "        ...           '''\n",
      "        \n",
      "        >>> print(script_from_examples(text))\n",
      "        # Here are examples of simple math.\n",
      "        #\n",
      "        #     Python has super accurate integer addition\n",
      "        #\n",
      "        2 + 2\n",
      "        # Expected:\n",
      "        ## 5\n",
      "        #\n",
      "        #     And very friendly error messages:\n",
      "        #\n",
      "        1/0\n",
      "        # Expected:\n",
      "        ## To Infinity\n",
      "        ## And\n",
      "        ## Beyond\n",
      "        #\n",
      "        #     You can use logic if you want:\n",
      "        #\n",
      "        if 0:\n",
      "           blah\n",
      "           blah\n",
      "        #\n",
      "        #     Ho hum\n",
      "        <BLANKLINE>\n",
      "    \n",
      "    set_unittest_reportflags(flags)\n",
      "        Sets the unittest option flags.\n",
      "        \n",
      "        The old flag is returned so that a runner could restore the old\n",
      "        value if it wished to:\n",
      "        \n",
      "          >>> import doctest\n",
      "          >>> old = doctest._unittest_reportflags\n",
      "          >>> doctest.set_unittest_reportflags(REPORT_NDIFF |\n",
      "          ...                          REPORT_ONLY_FIRST_FAILURE) == old\n",
      "          True\n",
      "        \n",
      "          >>> doctest._unittest_reportflags == (REPORT_NDIFF |\n",
      "          ...                                   REPORT_ONLY_FIRST_FAILURE)\n",
      "          True\n",
      "        \n",
      "        Only reporting flags can be set:\n",
      "        \n",
      "          >>> doctest.set_unittest_reportflags(ELLIPSIS)\n",
      "          Traceback (most recent call last):\n",
      "          ...\n",
      "          ValueError: ('Only reporting flags allowed', 8)\n",
      "        \n",
      "          >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |\n",
      "          ...                                   REPORT_ONLY_FIRST_FAILURE)\n",
      "          True\n",
      "    \n",
      "    testfile(filename, module_relative=True, name=None, package=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, parser=<doctest.DocTestParser object at 0x000001FAF6D18B80>, encoding=None)\n",
      "        Test examples in the given file.  Return (#failures, #tests).\n",
      "        \n",
      "        Optional keyword arg \"module_relative\" specifies how filenames\n",
      "        should be interpreted:\n",
      "        \n",
      "          - If \"module_relative\" is True (the default), then \"filename\"\n",
      "             specifies a module-relative path.  By default, this path is\n",
      "             relative to the calling module's directory; but if the\n",
      "             \"package\" argument is specified, then it is relative to that\n",
      "             package.  To ensure os-independence, \"filename\" should use\n",
      "             \"/\" characters to separate path segments, and should not\n",
      "             be an absolute path (i.e., it may not begin with \"/\").\n",
      "        \n",
      "          - If \"module_relative\" is False, then \"filename\" specifies an\n",
      "            os-specific path.  The path may be absolute or relative (to\n",
      "            the current working directory).\n",
      "        \n",
      "        Optional keyword arg \"name\" gives the name of the test; by default\n",
      "        use the file's basename.\n",
      "        \n",
      "        Optional keyword argument \"package\" is a Python package or the\n",
      "        name of a Python package whose directory should be used as the\n",
      "        base directory for a module relative filename.  If no package is\n",
      "        specified, then the calling module's directory is used as the base\n",
      "        directory for module relative filenames.  It is an error to\n",
      "        specify \"package\" if \"module_relative\" is False.\n",
      "        \n",
      "        Optional keyword arg \"globs\" gives a dict to be used as the globals\n",
      "        when executing examples; by default, use {}.  A copy of this dict\n",
      "        is actually used for each docstring, so that each docstring's\n",
      "        examples start with a clean slate.\n",
      "        \n",
      "        Optional keyword arg \"extraglobs\" gives a dictionary that should be\n",
      "        merged into the globals that are used to execute examples.  By\n",
      "        default, no extra globals are used.\n",
      "        \n",
      "        Optional keyword arg \"verbose\" prints lots of stuff if true, prints\n",
      "        only failures if false; by default, it's true iff \"-v\" is in sys.argv.\n",
      "        \n",
      "        Optional keyword arg \"report\" prints a summary at the end when true,\n",
      "        else prints nothing at the end.  In verbose mode, the summary is\n",
      "        detailed, else very brief (in fact, empty if all tests passed).\n",
      "        \n",
      "        Optional keyword arg \"optionflags\" or's together module constants,\n",
      "        and defaults to 0.  Possible values (see the docs for details):\n",
      "        \n",
      "            DONT_ACCEPT_TRUE_FOR_1\n",
      "            DONT_ACCEPT_BLANKLINE\n",
      "            NORMALIZE_WHITESPACE\n",
      "            ELLIPSIS\n",
      "            SKIP\n",
      "            IGNORE_EXCEPTION_DETAIL\n",
      "            REPORT_UDIFF\n",
      "            REPORT_CDIFF\n",
      "            REPORT_NDIFF\n",
      "            REPORT_ONLY_FIRST_FAILURE\n",
      "        \n",
      "        Optional keyword arg \"raise_on_error\" raises an exception on the\n",
      "        first unexpected exception or failure. This allows failures to be\n",
      "        post-mortem debugged.\n",
      "        \n",
      "        Optional keyword arg \"parser\" specifies a DocTestParser (or\n",
      "        subclass) that should be used to extract tests from the files.\n",
      "        \n",
      "        Optional keyword arg \"encoding\" specifies an encoding that should\n",
      "        be used to convert the file to unicode.\n",
      "        \n",
      "        Advanced tomfoolery:  testmod runs methods of a local instance of\n",
      "        class doctest.Tester, then merges the results into (or creates)\n",
      "        global Tester instance doctest.master.  Methods of doctest.master\n",
      "        can be called directly too, if you want to do something unusual.\n",
      "        Passing report=0 to testmod is especially useful then, to delay\n",
      "        displaying a summary.  Invoke doctest.master.summarize(verbose)\n",
      "        when you're done fiddling.\n",
      "    \n",
      "    testmod(m=None, name=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, exclude_empty=False)\n",
      "        m=None, name=None, globs=None, verbose=None, report=True,\n",
      "           optionflags=0, extraglobs=None, raise_on_error=False,\n",
      "           exclude_empty=False\n",
      "        \n",
      "        Test examples in docstrings in functions and classes reachable\n",
      "        from module m (or the current module if m is not supplied), starting\n",
      "        with m.__doc__.\n",
      "        \n",
      "        Also test examples reachable from dict m.__test__ if it exists and is\n",
      "        not None.  m.__test__ maps names to functions, classes and strings;\n",
      "        function and class docstrings are tested even if the name is private;\n",
      "        strings are tested directly, as if they were docstrings.\n",
      "        \n",
      "        Return (#failures, #tests).\n",
      "        \n",
      "        See help(doctest) for an overview.\n",
      "        \n",
      "        Optional keyword arg \"name\" gives the name of the module; by default\n",
      "        use m.__name__.\n",
      "        \n",
      "        Optional keyword arg \"globs\" gives a dict to be used as the globals\n",
      "        when executing examples; by default, use m.__dict__.  A copy of this\n",
      "        dict is actually used for each docstring, so that each docstring's\n",
      "        examples start with a clean slate.\n",
      "        \n",
      "        Optional keyword arg \"extraglobs\" gives a dictionary that should be\n",
      "        merged into the globals that are used to execute examples.  By\n",
      "        default, no extra globals are used.  This is new in 2.4.\n",
      "        \n",
      "        Optional keyword arg \"verbose\" prints lots of stuff if true, prints\n",
      "        only failures if false; by default, it's true iff \"-v\" is in sys.argv.\n",
      "        \n",
      "        Optional keyword arg \"report\" prints a summary at the end when true,\n",
      "        else prints nothing at the end.  In verbose mode, the summary is\n",
      "        detailed, else very brief (in fact, empty if all tests passed).\n",
      "        \n",
      "        Optional keyword arg \"optionflags\" or's together module constants,\n",
      "        and defaults to 0.  This is new in 2.3.  Possible values (see the\n",
      "        docs for details):\n",
      "        \n",
      "            DONT_ACCEPT_TRUE_FOR_1\n",
      "            DONT_ACCEPT_BLANKLINE\n",
      "            NORMALIZE_WHITESPACE\n",
      "            ELLIPSIS\n",
      "            SKIP\n",
      "            IGNORE_EXCEPTION_DETAIL\n",
      "            REPORT_UDIFF\n",
      "            REPORT_CDIFF\n",
      "            REPORT_NDIFF\n",
      "            REPORT_ONLY_FIRST_FAILURE\n",
      "        \n",
      "        Optional keyword arg \"raise_on_error\" raises an exception on the\n",
      "        first unexpected exception or failure. This allows failures to be\n",
      "        post-mortem debugged.\n",
      "        \n",
      "        Advanced tomfoolery:  testmod runs methods of a local instance of\n",
      "        class doctest.Tester, then merges the results into (or creates)\n",
      "        global Tester instance doctest.master.  Methods of doctest.master\n",
      "        can be called directly too, if you want to do something unusual.\n",
      "        Passing report=0 to testmod is especially useful then, to delay\n",
      "        displaying a summary.  Invoke doctest.master.summarize(verbose)\n",
      "        when you're done fiddling.\n",
      "    \n",
      "    testsource(module, name)\n",
      "        Extract the test sources from a doctest docstring as a script.\n",
      "        \n",
      "        Provide the module (or dotted name of the module) containing the\n",
      "        test to be debugged and the name (within the module) of the object\n",
      "        with the doc string with tests to be debugged.\n",
      "\n",
      "DATA\n",
      "    COMPARISON_FLAGS = 63\n",
      "    DONT_ACCEPT_BLANKLINE = 2\n",
      "    DONT_ACCEPT_TRUE_FOR_1 = 1\n",
      "    ELLIPSIS = 8\n",
      "    FAIL_FAST = 1024\n",
      "    IGNORE_EXCEPTION_DETAIL = 32\n",
      "    NORMALIZE_WHITESPACE = 4\n",
      "    REPORTING_FLAGS = 1984\n",
      "    REPORT_CDIFF = 128\n",
      "    REPORT_NDIFF = 256\n",
      "    REPORT_ONLY_FIRST_FAILURE = 512\n",
      "    REPORT_UDIFF = 64\n",
      "    SKIP = 16\n",
      "    __all__ = ['register_optionflag', 'DONT_ACCEPT_TRUE_FOR_1', 'DONT_ACCE...\n",
      "    __docformat__ = 'reStructuredText en'\n",
      "    __test__ = {'_TestClass': <class 'doctest._TestClass'>, 'blank lines':...\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\doctest.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import doctest\n",
    "help(doctest)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "f3aa8fc2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on package unittest:\n",
      "\n",
      "NAME\n",
      "    unittest\n",
      "\n",
      "MODULE REFERENCE\n",
      "    https://docs.python.org/3.8/library/unittest\n",
      "    \n",
      "    The following documentation is automatically generated from the Python\n",
      "    source files.  It may be incomplete, incorrect or include features that\n",
      "    are considered implementation detail and may vary between Python\n",
      "    implementations.  When in doubt, consult the module reference at the\n",
      "    location listed above.\n",
      "\n",
      "DESCRIPTION\n",
      "    Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's\n",
      "    Smalltalk testing framework (used with permission).\n",
      "    \n",
      "    This module contains the core framework classes that form the basis of\n",
      "    specific test cases and suites (TestCase, TestSuite etc.), and also a\n",
      "    text-based utility class for running the tests and reporting the results\n",
      "     (TextTestRunner).\n",
      "    \n",
      "    Simple usage:\n",
      "    \n",
      "        import unittest\n",
      "    \n",
      "        class IntegerArithmeticTestCase(unittest.TestCase):\n",
      "            def testAdd(self):  # test method names begin with 'test'\n",
      "                self.assertEqual((1 + 2), 3)\n",
      "                self.assertEqual(0 + 1, 1)\n",
      "            def testMultiply(self):\n",
      "                self.assertEqual((0 * 10), 0)\n",
      "                self.assertEqual((5 * 8), 40)\n",
      "    \n",
      "        if __name__ == '__main__':\n",
      "            unittest.main()\n",
      "    \n",
      "    Further information is available in the bundled documentation, and from\n",
      "    \n",
      "      http://docs.python.org/library/unittest.html\n",
      "    \n",
      "    Copyright (c) 1999-2003 Steve Purcell\n",
      "    Copyright (c) 2003-2010 Python Software Foundation\n",
      "    This module is free software, and you may redistribute it and/or modify\n",
      "    it under the same terms as Python itself, so long as this copyright message\n",
      "    and disclaimer are retained in their original form.\n",
      "    \n",
      "    IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,\n",
      "    SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF\n",
      "    THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\n",
      "    DAMAGE.\n",
      "    \n",
      "    THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT\n",
      "    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n",
      "    PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN \"AS IS\" BASIS,\n",
      "    AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,\n",
      "    SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n",
      "\n",
      "PACKAGE CONTENTS\n",
      "    __main__\n",
      "    async_case\n",
      "    case\n",
      "    loader\n",
      "    main\n",
      "    mock\n",
      "    result\n",
      "    runner\n",
      "    signals\n",
      "    suite\n",
      "    test (package)\n",
      "    util\n",
      "\n",
      "CLASSES\n",
      "    builtins.Exception(builtins.BaseException)\n",
      "        unittest.case.SkipTest\n",
      "    builtins.object\n",
      "        unittest.case.TestCase\n",
      "            unittest.async_case.IsolatedAsyncioTestCase\n",
      "            unittest.case.FunctionTestCase\n",
      "        unittest.loader.TestLoader\n",
      "        unittest.main.TestProgram\n",
      "        unittest.result.TestResult\n",
      "            unittest.runner.TextTestResult\n",
      "        unittest.runner.TextTestRunner\n",
      "    unittest.suite.BaseTestSuite(builtins.object)\n",
      "        unittest.suite.TestSuite\n",
      "    \n",
      "    class FunctionTestCase(TestCase)\n",
      "     |  FunctionTestCase(testFunc, setUp=None, tearDown=None, description=None)\n",
      "     |  \n",
      "     |  A test case that wraps a test function.\n",
      "     |  \n",
      "     |  This is useful for slipping pre-existing test functions into the\n",
      "     |  unittest framework. Optionally, set-up and tidy-up functions can be\n",
      "     |  supplied. As with TestCase, the tidy-up ('tearDown') function will\n",
      "     |  always be called if the set-up ('setUp') function ran successfully.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      FunctionTestCase\n",
      "     |      TestCase\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self, testFunc, setUp=None, tearDown=None, description=None)\n",
      "     |      Create an instance of the class that will use the named test\n",
      "     |      method when executed. Raises a ValueError if the instance does\n",
      "     |      not have a method with the specified name.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  id(self)\n",
      "     |  \n",
      "     |  runTest(self)\n",
      "     |  \n",
      "     |  setUp(self)\n",
      "     |      Hook method for setting up the test fixture before exercising it.\n",
      "     |  \n",
      "     |  shortDescription(self)\n",
      "     |      Returns a one-line description of the test, or None if no\n",
      "     |      description has been provided.\n",
      "     |      \n",
      "     |      The default implementation of this method returns the first line of\n",
      "     |      the specified test method's docstring.\n",
      "     |  \n",
      "     |  tearDown(self)\n",
      "     |      Hook method for deconstructing the test fixture after testing it.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from TestCase:\n",
      "     |  \n",
      "     |  __call__(self, *args, **kwds)\n",
      "     |      Call self as a function.\n",
      "     |  \n",
      "     |  addCleanup(self, function, /, *args, **kwargs)\n",
      "     |      Add a function, with arguments, to be called when the test is\n",
      "     |      completed. Functions added are called on a LIFO basis and are\n",
      "     |      called after tearDown on test failure or success.\n",
      "     |      \n",
      "     |      Cleanup items are called even if setUp fails (unlike tearDown).\n",
      "     |  \n",
      "     |  addTypeEqualityFunc(self, typeobj, function)\n",
      "     |      Add a type specific assertEqual style function to compare a type.\n",
      "     |      \n",
      "     |      This method is for use by TestCase subclasses that need to register\n",
      "     |      their own type equality functions to provide nicer error messages.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          typeobj: The data type to call this function on when both values\n",
      "     |                  are of the same type in assertEqual().\n",
      "     |          function: The callable taking two arguments and an optional\n",
      "     |                  msg= argument that raises self.failureException with a\n",
      "     |                  useful error message when the two arguments are not equal.\n",
      "     |  \n",
      "     |  assertAlmostEqual(self, first, second, places=None, msg=None, delta=None)\n",
      "     |      Fail if the two objects are unequal as determined by their\n",
      "     |      difference rounded to the given number of decimal places\n",
      "     |      (default 7) and comparing to zero, or by comparing that the\n",
      "     |      difference between the two objects is more than the given\n",
      "     |      delta.\n",
      "     |      \n",
      "     |      Note that decimal places (from zero) are usually not the same\n",
      "     |      as significant digits (measured from the most significant digit).\n",
      "     |      \n",
      "     |      If the two objects compare equal then they will automatically\n",
      "     |      compare almost equal.\n",
      "     |  \n",
      "     |  assertAlmostEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertCountEqual(self, first, second, msg=None)\n",
      "     |      Asserts that two iterables have the same elements, the same number of\n",
      "     |      times, without regard to order.\n",
      "     |      \n",
      "     |          self.assertEqual(Counter(list(first)),\n",
      "     |                           Counter(list(second)))\n",
      "     |      \n",
      "     |       Example:\n",
      "     |          - [0, 1, 1] and [1, 0, 1] compare equal.\n",
      "     |          - [0, 0, 1] and [0, 1] compare unequal.\n",
      "     |  \n",
      "     |  assertDictContainsSubset(self, subset, dictionary, msg=None)\n",
      "     |      Checks whether dictionary is a superset of subset.\n",
      "     |  \n",
      "     |  assertDictEqual(self, d1, d2, msg=None)\n",
      "     |  \n",
      "     |  assertEqual(self, first, second, msg=None)\n",
      "     |      Fail if the two objects are unequal as determined by the '=='\n",
      "     |      operator.\n",
      "     |  \n",
      "     |  assertEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertFalse(self, expr, msg=None)\n",
      "     |      Check that the expression is false.\n",
      "     |  \n",
      "     |  assertGreater(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a > b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertGreaterEqual(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a >= b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIn(self, member, container, msg=None)\n",
      "     |      Just like self.assertTrue(a in b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIs(self, expr1, expr2, msg=None)\n",
      "     |      Just like self.assertTrue(a is b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsInstance(self, obj, cls, msg=None)\n",
      "     |      Same as self.assertTrue(isinstance(obj, cls)), with a nicer\n",
      "     |      default message.\n",
      "     |  \n",
      "     |  assertIsNone(self, obj, msg=None)\n",
      "     |      Same as self.assertTrue(obj is None), with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsNot(self, expr1, expr2, msg=None)\n",
      "     |      Just like self.assertTrue(a is not b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsNotNone(self, obj, msg=None)\n",
      "     |      Included for symmetry with assertIsNone.\n",
      "     |  \n",
      "     |  assertLess(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a < b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertLessEqual(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a <= b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertListEqual(self, list1, list2, msg=None)\n",
      "     |      A list-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          list1: The first list to compare.\n",
      "     |          list2: The second list to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertLogs(self, logger=None, level=None)\n",
      "     |      Fail unless a log message of level *level* or higher is emitted\n",
      "     |      on *logger_name* or its children.  If omitted, *level* defaults to\n",
      "     |      INFO and *logger* defaults to the root logger.\n",
      "     |      \n",
      "     |      This method must be used as a context manager, and will yield\n",
      "     |      a recording object with two attributes: `output` and `records`.\n",
      "     |      At the end of the context manager, the `output` attribute will\n",
      "     |      be a list of the matching formatted log messages and the\n",
      "     |      `records` attribute will be a list of the corresponding LogRecord\n",
      "     |      objects.\n",
      "     |      \n",
      "     |      Example::\n",
      "     |      \n",
      "     |          with self.assertLogs('foo', level='INFO') as cm:\n",
      "     |              logging.getLogger('foo').info('first message')\n",
      "     |              logging.getLogger('foo.bar').error('second message')\n",
      "     |          self.assertEqual(cm.output, ['INFO:foo:first message',\n",
      "     |                                       'ERROR:foo.bar:second message'])\n",
      "     |  \n",
      "     |  assertMultiLineEqual(self, first, second, msg=None)\n",
      "     |      Assert that two multi-line strings are equal.\n",
      "     |  \n",
      "     |  assertNotAlmostEqual(self, first, second, places=None, msg=None, delta=None)\n",
      "     |      Fail if the two objects are equal as determined by their\n",
      "     |      difference rounded to the given number of decimal places\n",
      "     |      (default 7) and comparing to zero, or by comparing that the\n",
      "     |      difference between the two objects is less than the given delta.\n",
      "     |      \n",
      "     |      Note that decimal places (from zero) are usually not the same\n",
      "     |      as significant digits (measured from the most significant digit).\n",
      "     |      \n",
      "     |      Objects that are equal automatically fail.\n",
      "     |  \n",
      "     |  assertNotAlmostEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertNotEqual(self, first, second, msg=None)\n",
      "     |      Fail if the two objects are equal as determined by the '!='\n",
      "     |      operator.\n",
      "     |  \n",
      "     |  assertNotEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertNotIn(self, member, container, msg=None)\n",
      "     |      Just like self.assertTrue(a not in b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertNotIsInstance(self, obj, cls, msg=None)\n",
      "     |      Included for symmetry with assertIsInstance.\n",
      "     |  \n",
      "     |  assertNotRegex(self, text, unexpected_regex, msg=None)\n",
      "     |      Fail the test if the text matches the regular expression.\n",
      "     |  \n",
      "     |  assertNotRegexpMatches = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertRaises(self, expected_exception, *args, **kwargs)\n",
      "     |      Fail unless an exception of class expected_exception is raised\n",
      "     |      by the callable when invoked with specified positional and\n",
      "     |      keyword arguments. If a different type of exception is\n",
      "     |      raised, it will not be caught, and the test case will be\n",
      "     |      deemed to have suffered an error, exactly as for an\n",
      "     |      unexpected exception.\n",
      "     |      \n",
      "     |      If called with the callable and arguments omitted, will return a\n",
      "     |      context object used like this::\n",
      "     |      \n",
      "     |           with self.assertRaises(SomeException):\n",
      "     |               do_something()\n",
      "     |      \n",
      "     |      An optional keyword argument 'msg' can be provided when assertRaises\n",
      "     |      is used as a context object.\n",
      "     |      \n",
      "     |      The context manager keeps a reference to the exception as\n",
      "     |      the 'exception' attribute. This allows you to inspect the\n",
      "     |      exception after the assertion::\n",
      "     |      \n",
      "     |          with self.assertRaises(SomeException) as cm:\n",
      "     |              do_something()\n",
      "     |          the_exception = cm.exception\n",
      "     |          self.assertEqual(the_exception.error_code, 3)\n",
      "     |  \n",
      "     |  assertRaisesRegex(self, expected_exception, expected_regex, *args, **kwargs)\n",
      "     |      Asserts that the message in a raised exception matches a regex.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          expected_exception: Exception class expected to be raised.\n",
      "     |          expected_regex: Regex (re.Pattern object or string) expected\n",
      "     |                  to be found in error message.\n",
      "     |          args: Function to be called and extra positional args.\n",
      "     |          kwargs: Extra kwargs.\n",
      "     |          msg: Optional message used in case of failure. Can only be used\n",
      "     |                  when assertRaisesRegex is used as a context manager.\n",
      "     |  \n",
      "     |  assertRaisesRegexp = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertRegex(self, text, expected_regex, msg=None)\n",
      "     |      Fail the test unless the text matches the regular expression.\n",
      "     |  \n",
      "     |  assertRegexpMatches = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None)\n",
      "     |      An equality assertion for ordered sequences (like lists and tuples).\n",
      "     |      \n",
      "     |      For the purposes of this function, a valid ordered sequence type is one\n",
      "     |      which can be indexed, has a length, and has an equality operator.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          seq1: The first sequence to compare.\n",
      "     |          seq2: The second sequence to compare.\n",
      "     |          seq_type: The expected datatype of the sequences, or None if no\n",
      "     |                  datatype should be enforced.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertSetEqual(self, set1, set2, msg=None)\n",
      "     |      A set-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          set1: The first set to compare.\n",
      "     |          set2: The second set to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |      \n",
      "     |      assertSetEqual uses ducktyping to support different types of sets, and\n",
      "     |      is optimized for sets specifically (parameters must support a\n",
      "     |      difference method).\n",
      "     |  \n",
      "     |  assertTrue(self, expr, msg=None)\n",
      "     |      Check that the expression is true.\n",
      "     |  \n",
      "     |  assertTupleEqual(self, tuple1, tuple2, msg=None)\n",
      "     |      A tuple-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          tuple1: The first tuple to compare.\n",
      "     |          tuple2: The second tuple to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertWarns(self, expected_warning, *args, **kwargs)\n",
      "     |      Fail unless a warning of class warnClass is triggered\n",
      "     |      by the callable when invoked with specified positional and\n",
      "     |      keyword arguments.  If a different type of warning is\n",
      "     |      triggered, it will not be handled: depending on the other\n",
      "     |      warning filtering rules in effect, it might be silenced, printed\n",
      "     |      out, or raised as an exception.\n",
      "     |      \n",
      "     |      If called with the callable and arguments omitted, will return a\n",
      "     |      context object used like this::\n",
      "     |      \n",
      "     |           with self.assertWarns(SomeWarning):\n",
      "     |               do_something()\n",
      "     |      \n",
      "     |      An optional keyword argument 'msg' can be provided when assertWarns\n",
      "     |      is used as a context object.\n",
      "     |      \n",
      "     |      The context manager keeps a reference to the first matching\n",
      "     |      warning as the 'warning' attribute; similarly, the 'filename'\n",
      "     |      and 'lineno' attributes give you information about the line\n",
      "     |      of Python code from which the warning was triggered.\n",
      "     |      This allows you to inspect the warning after the assertion::\n",
      "     |      \n",
      "     |          with self.assertWarns(SomeWarning) as cm:\n",
      "     |              do_something()\n",
      "     |          the_warning = cm.warning\n",
      "     |          self.assertEqual(the_warning.some_attribute, 147)\n",
      "     |  \n",
      "     |  assertWarnsRegex(self, expected_warning, expected_regex, *args, **kwargs)\n",
      "     |      Asserts that the message in a triggered warning matches a regexp.\n",
      "     |      Basic functioning is similar to assertWarns() with the addition\n",
      "     |      that only warnings whose messages also match the regular expression\n",
      "     |      are considered successful matches.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          expected_warning: Warning class expected to be triggered.\n",
      "     |          expected_regex: Regex (re.Pattern object or string) expected\n",
      "     |                  to be found in error message.\n",
      "     |          args: Function to be called and extra positional args.\n",
      "     |          kwargs: Extra kwargs.\n",
      "     |          msg: Optional message used in case of failure. Can only be used\n",
      "     |                  when assertWarnsRegex is used as a context manager.\n",
      "     |  \n",
      "     |  assert_ = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  countTestCases(self)\n",
      "     |  \n",
      "     |  debug(self)\n",
      "     |      Run the test without collecting errors in a TestResult\n",
      "     |  \n",
      "     |  defaultTestResult(self)\n",
      "     |  \n",
      "     |  doCleanups(self)\n",
      "     |      Execute all cleanup functions. Normally called for you after\n",
      "     |      tearDown.\n",
      "     |  \n",
      "     |  fail(self, msg=None)\n",
      "     |      Fail immediately, with the given message.\n",
      "     |  \n",
      "     |  failIf = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failIfAlmostEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failIfEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnless = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessAlmostEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessRaises = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  run(self, result=None)\n",
      "     |  \n",
      "     |  skipTest(self, reason)\n",
      "     |      Skip this test.\n",
      "     |  \n",
      "     |  subTest(self, msg=<object object at 0x000001FAF6959550>, **params)\n",
      "     |      Return a context manager that will return the enclosed block\n",
      "     |      of code in a subtest identified by the optional message and\n",
      "     |      keyword parameters.  A failure in the subtest marks the test\n",
      "     |      case as failed but resumes execution at the end of the enclosed\n",
      "     |      block, allowing further test code to be executed.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods inherited from TestCase:\n",
      "     |  \n",
      "     |  addClassCleanup(function, /, *args, **kwargs) from builtins.type\n",
      "     |      Same as addCleanup, except the cleanup items are called even if\n",
      "     |      setUpClass fails (unlike tearDownClass).\n",
      "     |  \n",
      "     |  doClassCleanups() from builtins.type\n",
      "     |      Execute all class cleanup functions. Normally called for you after\n",
      "     |      tearDownClass.\n",
      "     |  \n",
      "     |  setUpClass() from builtins.type\n",
      "     |      Hook method for setting up class fixture before running tests in the class.\n",
      "     |  \n",
      "     |  tearDownClass() from builtins.type\n",
      "     |      Hook method for deconstructing the class fixture after running all tests in the class.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from TestCase:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from TestCase:\n",
      "     |  \n",
      "     |  failureException = <class 'AssertionError'>\n",
      "     |      Assertion failed.\n",
      "     |  \n",
      "     |  longMessage = True\n",
      "     |  \n",
      "     |  maxDiff = 640\n",
      "    \n",
      "    class IsolatedAsyncioTestCase(unittest.case.TestCase)\n",
      "     |  IsolatedAsyncioTestCase(methodName='runTest')\n",
      "     |  \n",
      "     |  A class whose instances are single test cases.\n",
      "     |  \n",
      "     |  By default, the test code itself should be placed in a method named\n",
      "     |  'runTest'.\n",
      "     |  \n",
      "     |  If the fixture may be used for many test cases, create as\n",
      "     |  many test methods as are needed. When instantiating such a TestCase\n",
      "     |  subclass, specify in the constructor arguments the name of the test method\n",
      "     |  that the instance is to execute.\n",
      "     |  \n",
      "     |  Test authors should subclass TestCase for their own tests. Construction\n",
      "     |  and deconstruction of the test's environment ('fixture') can be\n",
      "     |  implemented by overriding the 'setUp' and 'tearDown' methods respectively.\n",
      "     |  \n",
      "     |  If it is necessary to override the __init__ method, the base class\n",
      "     |  __init__ method must always be called. It is important that subclasses\n",
      "     |  should not change the signature of their __init__ method, since instances\n",
      "     |  of the classes are instantiated automatically by parts of the framework\n",
      "     |  in order to be run.\n",
      "     |  \n",
      "     |  When subclassing TestCase, you can set these attributes:\n",
      "     |  * failureException: determines which exception will be raised when\n",
      "     |      the instance's assertion methods fail; test methods raising this\n",
      "     |      exception will be deemed to have 'failed' rather than 'errored'.\n",
      "     |  * longMessage: determines whether long messages (including repr of\n",
      "     |      objects used in assert methods) will be printed on failure in *addition*\n",
      "     |      to any explicit message passed.\n",
      "     |  * maxDiff: sets the maximum length of a diff in failure messages\n",
      "     |      by assert methods using difflib. It is looked up as an instance\n",
      "     |      attribute so can be configured by individual tests if required.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      IsolatedAsyncioTestCase\n",
      "     |      unittest.case.TestCase\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, methodName='runTest')\n",
      "     |      Create an instance of the class that will use the named test\n",
      "     |      method when executed. Raises a ValueError if the instance does\n",
      "     |      not have a method with the specified name.\n",
      "     |  \n",
      "     |  addAsyncCleanup(self, func, /, *args, **kwargs)\n",
      "     |  \n",
      "     |  async asyncSetUp(self)\n",
      "     |  \n",
      "     |  async asyncTearDown(self)\n",
      "     |  \n",
      "     |  run(self, result=None)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from unittest.case.TestCase:\n",
      "     |  \n",
      "     |  __call__(self, *args, **kwds)\n",
      "     |      Call self as a function.\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  addCleanup(self, function, /, *args, **kwargs)\n",
      "     |      Add a function, with arguments, to be called when the test is\n",
      "     |      completed. Functions added are called on a LIFO basis and are\n",
      "     |      called after tearDown on test failure or success.\n",
      "     |      \n",
      "     |      Cleanup items are called even if setUp fails (unlike tearDown).\n",
      "     |  \n",
      "     |  addTypeEqualityFunc(self, typeobj, function)\n",
      "     |      Add a type specific assertEqual style function to compare a type.\n",
      "     |      \n",
      "     |      This method is for use by TestCase subclasses that need to register\n",
      "     |      their own type equality functions to provide nicer error messages.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          typeobj: The data type to call this function on when both values\n",
      "     |                  are of the same type in assertEqual().\n",
      "     |          function: The callable taking two arguments and an optional\n",
      "     |                  msg= argument that raises self.failureException with a\n",
      "     |                  useful error message when the two arguments are not equal.\n",
      "     |  \n",
      "     |  assertAlmostEqual(self, first, second, places=None, msg=None, delta=None)\n",
      "     |      Fail if the two objects are unequal as determined by their\n",
      "     |      difference rounded to the given number of decimal places\n",
      "     |      (default 7) and comparing to zero, or by comparing that the\n",
      "     |      difference between the two objects is more than the given\n",
      "     |      delta.\n",
      "     |      \n",
      "     |      Note that decimal places (from zero) are usually not the same\n",
      "     |      as significant digits (measured from the most significant digit).\n",
      "     |      \n",
      "     |      If the two objects compare equal then they will automatically\n",
      "     |      compare almost equal.\n",
      "     |  \n",
      "     |  assertAlmostEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertCountEqual(self, first, second, msg=None)\n",
      "     |      Asserts that two iterables have the same elements, the same number of\n",
      "     |      times, without regard to order.\n",
      "     |      \n",
      "     |          self.assertEqual(Counter(list(first)),\n",
      "     |                           Counter(list(second)))\n",
      "     |      \n",
      "     |       Example:\n",
      "     |          - [0, 1, 1] and [1, 0, 1] compare equal.\n",
      "     |          - [0, 0, 1] and [0, 1] compare unequal.\n",
      "     |  \n",
      "     |  assertDictContainsSubset(self, subset, dictionary, msg=None)\n",
      "     |      Checks whether dictionary is a superset of subset.\n",
      "     |  \n",
      "     |  assertDictEqual(self, d1, d2, msg=None)\n",
      "     |  \n",
      "     |  assertEqual(self, first, second, msg=None)\n",
      "     |      Fail if the two objects are unequal as determined by the '=='\n",
      "     |      operator.\n",
      "     |  \n",
      "     |  assertEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertFalse(self, expr, msg=None)\n",
      "     |      Check that the expression is false.\n",
      "     |  \n",
      "     |  assertGreater(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a > b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertGreaterEqual(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a >= b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIn(self, member, container, msg=None)\n",
      "     |      Just like self.assertTrue(a in b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIs(self, expr1, expr2, msg=None)\n",
      "     |      Just like self.assertTrue(a is b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsInstance(self, obj, cls, msg=None)\n",
      "     |      Same as self.assertTrue(isinstance(obj, cls)), with a nicer\n",
      "     |      default message.\n",
      "     |  \n",
      "     |  assertIsNone(self, obj, msg=None)\n",
      "     |      Same as self.assertTrue(obj is None), with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsNot(self, expr1, expr2, msg=None)\n",
      "     |      Just like self.assertTrue(a is not b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsNotNone(self, obj, msg=None)\n",
      "     |      Included for symmetry with assertIsNone.\n",
      "     |  \n",
      "     |  assertLess(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a < b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertLessEqual(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a <= b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertListEqual(self, list1, list2, msg=None)\n",
      "     |      A list-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          list1: The first list to compare.\n",
      "     |          list2: The second list to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertLogs(self, logger=None, level=None)\n",
      "     |      Fail unless a log message of level *level* or higher is emitted\n",
      "     |      on *logger_name* or its children.  If omitted, *level* defaults to\n",
      "     |      INFO and *logger* defaults to the root logger.\n",
      "     |      \n",
      "     |      This method must be used as a context manager, and will yield\n",
      "     |      a recording object with two attributes: `output` and `records`.\n",
      "     |      At the end of the context manager, the `output` attribute will\n",
      "     |      be a list of the matching formatted log messages and the\n",
      "     |      `records` attribute will be a list of the corresponding LogRecord\n",
      "     |      objects.\n",
      "     |      \n",
      "     |      Example::\n",
      "     |      \n",
      "     |          with self.assertLogs('foo', level='INFO') as cm:\n",
      "     |              logging.getLogger('foo').info('first message')\n",
      "     |              logging.getLogger('foo.bar').error('second message')\n",
      "     |          self.assertEqual(cm.output, ['INFO:foo:first message',\n",
      "     |                                       'ERROR:foo.bar:second message'])\n",
      "     |  \n",
      "     |  assertMultiLineEqual(self, first, second, msg=None)\n",
      "     |      Assert that two multi-line strings are equal.\n",
      "     |  \n",
      "     |  assertNotAlmostEqual(self, first, second, places=None, msg=None, delta=None)\n",
      "     |      Fail if the two objects are equal as determined by their\n",
      "     |      difference rounded to the given number of decimal places\n",
      "     |      (default 7) and comparing to zero, or by comparing that the\n",
      "     |      difference between the two objects is less than the given delta.\n",
      "     |      \n",
      "     |      Note that decimal places (from zero) are usually not the same\n",
      "     |      as significant digits (measured from the most significant digit).\n",
      "     |      \n",
      "     |      Objects that are equal automatically fail.\n",
      "     |  \n",
      "     |  assertNotAlmostEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertNotEqual(self, first, second, msg=None)\n",
      "     |      Fail if the two objects are equal as determined by the '!='\n",
      "     |      operator.\n",
      "     |  \n",
      "     |  assertNotEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertNotIn(self, member, container, msg=None)\n",
      "     |      Just like self.assertTrue(a not in b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertNotIsInstance(self, obj, cls, msg=None)\n",
      "     |      Included for symmetry with assertIsInstance.\n",
      "     |  \n",
      "     |  assertNotRegex(self, text, unexpected_regex, msg=None)\n",
      "     |      Fail the test if the text matches the regular expression.\n",
      "     |  \n",
      "     |  assertNotRegexpMatches = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertRaises(self, expected_exception, *args, **kwargs)\n",
      "     |      Fail unless an exception of class expected_exception is raised\n",
      "     |      by the callable when invoked with specified positional and\n",
      "     |      keyword arguments. If a different type of exception is\n",
      "     |      raised, it will not be caught, and the test case will be\n",
      "     |      deemed to have suffered an error, exactly as for an\n",
      "     |      unexpected exception.\n",
      "     |      \n",
      "     |      If called with the callable and arguments omitted, will return a\n",
      "     |      context object used like this::\n",
      "     |      \n",
      "     |           with self.assertRaises(SomeException):\n",
      "     |               do_something()\n",
      "     |      \n",
      "     |      An optional keyword argument 'msg' can be provided when assertRaises\n",
      "     |      is used as a context object.\n",
      "     |      \n",
      "     |      The context manager keeps a reference to the exception as\n",
      "     |      the 'exception' attribute. This allows you to inspect the\n",
      "     |      exception after the assertion::\n",
      "     |      \n",
      "     |          with self.assertRaises(SomeException) as cm:\n",
      "     |              do_something()\n",
      "     |          the_exception = cm.exception\n",
      "     |          self.assertEqual(the_exception.error_code, 3)\n",
      "     |  \n",
      "     |  assertRaisesRegex(self, expected_exception, expected_regex, *args, **kwargs)\n",
      "     |      Asserts that the message in a raised exception matches a regex.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          expected_exception: Exception class expected to be raised.\n",
      "     |          expected_regex: Regex (re.Pattern object or string) expected\n",
      "     |                  to be found in error message.\n",
      "     |          args: Function to be called and extra positional args.\n",
      "     |          kwargs: Extra kwargs.\n",
      "     |          msg: Optional message used in case of failure. Can only be used\n",
      "     |                  when assertRaisesRegex is used as a context manager.\n",
      "     |  \n",
      "     |  assertRaisesRegexp = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertRegex(self, text, expected_regex, msg=None)\n",
      "     |      Fail the test unless the text matches the regular expression.\n",
      "     |  \n",
      "     |  assertRegexpMatches = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None)\n",
      "     |      An equality assertion for ordered sequences (like lists and tuples).\n",
      "     |      \n",
      "     |      For the purposes of this function, a valid ordered sequence type is one\n",
      "     |      which can be indexed, has a length, and has an equality operator.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          seq1: The first sequence to compare.\n",
      "     |          seq2: The second sequence to compare.\n",
      "     |          seq_type: The expected datatype of the sequences, or None if no\n",
      "     |                  datatype should be enforced.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertSetEqual(self, set1, set2, msg=None)\n",
      "     |      A set-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          set1: The first set to compare.\n",
      "     |          set2: The second set to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |      \n",
      "     |      assertSetEqual uses ducktyping to support different types of sets, and\n",
      "     |      is optimized for sets specifically (parameters must support a\n",
      "     |      difference method).\n",
      "     |  \n",
      "     |  assertTrue(self, expr, msg=None)\n",
      "     |      Check that the expression is true.\n",
      "     |  \n",
      "     |  assertTupleEqual(self, tuple1, tuple2, msg=None)\n",
      "     |      A tuple-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          tuple1: The first tuple to compare.\n",
      "     |          tuple2: The second tuple to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertWarns(self, expected_warning, *args, **kwargs)\n",
      "     |      Fail unless a warning of class warnClass is triggered\n",
      "     |      by the callable when invoked with specified positional and\n",
      "     |      keyword arguments.  If a different type of warning is\n",
      "     |      triggered, it will not be handled: depending on the other\n",
      "     |      warning filtering rules in effect, it might be silenced, printed\n",
      "     |      out, or raised as an exception.\n",
      "     |      \n",
      "     |      If called with the callable and arguments omitted, will return a\n",
      "     |      context object used like this::\n",
      "     |      \n",
      "     |           with self.assertWarns(SomeWarning):\n",
      "     |               do_something()\n",
      "     |      \n",
      "     |      An optional keyword argument 'msg' can be provided when assertWarns\n",
      "     |      is used as a context object.\n",
      "     |      \n",
      "     |      The context manager keeps a reference to the first matching\n",
      "     |      warning as the 'warning' attribute; similarly, the 'filename'\n",
      "     |      and 'lineno' attributes give you information about the line\n",
      "     |      of Python code from which the warning was triggered.\n",
      "     |      This allows you to inspect the warning after the assertion::\n",
      "     |      \n",
      "     |          with self.assertWarns(SomeWarning) as cm:\n",
      "     |              do_something()\n",
      "     |          the_warning = cm.warning\n",
      "     |          self.assertEqual(the_warning.some_attribute, 147)\n",
      "     |  \n",
      "     |  assertWarnsRegex(self, expected_warning, expected_regex, *args, **kwargs)\n",
      "     |      Asserts that the message in a triggered warning matches a regexp.\n",
      "     |      Basic functioning is similar to assertWarns() with the addition\n",
      "     |      that only warnings whose messages also match the regular expression\n",
      "     |      are considered successful matches.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          expected_warning: Warning class expected to be triggered.\n",
      "     |          expected_regex: Regex (re.Pattern object or string) expected\n",
      "     |                  to be found in error message.\n",
      "     |          args: Function to be called and extra positional args.\n",
      "     |          kwargs: Extra kwargs.\n",
      "     |          msg: Optional message used in case of failure. Can only be used\n",
      "     |                  when assertWarnsRegex is used as a context manager.\n",
      "     |  \n",
      "     |  assert_ = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  countTestCases(self)\n",
      "     |  \n",
      "     |  debug(self)\n",
      "     |      Run the test without collecting errors in a TestResult\n",
      "     |  \n",
      "     |  defaultTestResult(self)\n",
      "     |  \n",
      "     |  doCleanups(self)\n",
      "     |      Execute all cleanup functions. Normally called for you after\n",
      "     |      tearDown.\n",
      "     |  \n",
      "     |  fail(self, msg=None)\n",
      "     |      Fail immediately, with the given message.\n",
      "     |  \n",
      "     |  failIf = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failIfAlmostEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failIfEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnless = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessAlmostEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessRaises = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  id(self)\n",
      "     |  \n",
      "     |  setUp(self)\n",
      "     |      Hook method for setting up the test fixture before exercising it.\n",
      "     |  \n",
      "     |  shortDescription(self)\n",
      "     |      Returns a one-line description of the test, or None if no\n",
      "     |      description has been provided.\n",
      "     |      \n",
      "     |      The default implementation of this method returns the first line of\n",
      "     |      the specified test method's docstring.\n",
      "     |  \n",
      "     |  skipTest(self, reason)\n",
      "     |      Skip this test.\n",
      "     |  \n",
      "     |  subTest(self, msg=<object object at 0x000001FAF6959550>, **params)\n",
      "     |      Return a context manager that will return the enclosed block\n",
      "     |      of code in a subtest identified by the optional message and\n",
      "     |      keyword parameters.  A failure in the subtest marks the test\n",
      "     |      case as failed but resumes execution at the end of the enclosed\n",
      "     |      block, allowing further test code to be executed.\n",
      "     |  \n",
      "     |  tearDown(self)\n",
      "     |      Hook method for deconstructing the test fixture after testing it.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods inherited from unittest.case.TestCase:\n",
      "     |  \n",
      "     |  addClassCleanup(function, /, *args, **kwargs) from builtins.type\n",
      "     |      Same as addCleanup, except the cleanup items are called even if\n",
      "     |      setUpClass fails (unlike tearDownClass).\n",
      "     |  \n",
      "     |  doClassCleanups() from builtins.type\n",
      "     |      Execute all class cleanup functions. Normally called for you after\n",
      "     |      tearDownClass.\n",
      "     |  \n",
      "     |  setUpClass() from builtins.type\n",
      "     |      Hook method for setting up class fixture before running tests in the class.\n",
      "     |  \n",
      "     |  tearDownClass() from builtins.type\n",
      "     |      Hook method for deconstructing the class fixture after running all tests in the class.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from unittest.case.TestCase:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from unittest.case.TestCase:\n",
      "     |  \n",
      "     |  failureException = <class 'AssertionError'>\n",
      "     |      Assertion failed.\n",
      "     |  \n",
      "     |  longMessage = True\n",
      "     |  \n",
      "     |  maxDiff = 640\n",
      "    \n",
      "    class SkipTest(builtins.Exception)\n",
      "     |  Raise this exception in a test to skip it.\n",
      "     |  \n",
      "     |  Usually you can use TestCase.skipTest() or one of the skipping decorators\n",
      "     |  instead of raising this directly.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      SkipTest\n",
      "     |      builtins.Exception\n",
      "     |      builtins.BaseException\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.Exception:\n",
      "     |  \n",
      "     |  __init__(self, /, *args, **kwargs)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods inherited from builtins.Exception:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __delattr__(self, name, /)\n",
      "     |      Implement delattr(self, name).\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __setattr__(self, name, value, /)\n",
      "     |      Implement setattr(self, name, value).\n",
      "     |  \n",
      "     |  __setstate__(...)\n",
      "     |  \n",
      "     |  __str__(self, /)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  with_traceback(...)\n",
      "     |      Exception.with_traceback(tb) --\n",
      "     |      set self.__traceback__ to tb and return self.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from builtins.BaseException:\n",
      "     |  \n",
      "     |  __cause__\n",
      "     |      exception cause\n",
      "     |  \n",
      "     |  __context__\n",
      "     |      exception context\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |  \n",
      "     |  __suppress_context__\n",
      "     |  \n",
      "     |  __traceback__\n",
      "     |  \n",
      "     |  args\n",
      "    \n",
      "    class TestCase(builtins.object)\n",
      "     |  TestCase(methodName='runTest')\n",
      "     |  \n",
      "     |  A class whose instances are single test cases.\n",
      "     |  \n",
      "     |  By default, the test code itself should be placed in a method named\n",
      "     |  'runTest'.\n",
      "     |  \n",
      "     |  If the fixture may be used for many test cases, create as\n",
      "     |  many test methods as are needed. When instantiating such a TestCase\n",
      "     |  subclass, specify in the constructor arguments the name of the test method\n",
      "     |  that the instance is to execute.\n",
      "     |  \n",
      "     |  Test authors should subclass TestCase for their own tests. Construction\n",
      "     |  and deconstruction of the test's environment ('fixture') can be\n",
      "     |  implemented by overriding the 'setUp' and 'tearDown' methods respectively.\n",
      "     |  \n",
      "     |  If it is necessary to override the __init__ method, the base class\n",
      "     |  __init__ method must always be called. It is important that subclasses\n",
      "     |  should not change the signature of their __init__ method, since instances\n",
      "     |  of the classes are instantiated automatically by parts of the framework\n",
      "     |  in order to be run.\n",
      "     |  \n",
      "     |  When subclassing TestCase, you can set these attributes:\n",
      "     |  * failureException: determines which exception will be raised when\n",
      "     |      the instance's assertion methods fail; test methods raising this\n",
      "     |      exception will be deemed to have 'failed' rather than 'errored'.\n",
      "     |  * longMessage: determines whether long messages (including repr of\n",
      "     |      objects used in assert methods) will be printed on failure in *addition*\n",
      "     |      to any explicit message passed.\n",
      "     |  * maxDiff: sets the maximum length of a diff in failure messages\n",
      "     |      by assert methods using difflib. It is looked up as an instance\n",
      "     |      attribute so can be configured by individual tests if required.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __call__(self, *args, **kwds)\n",
      "     |      Call self as a function.\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __hash__(self)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __init__(self, methodName='runTest')\n",
      "     |      Create an instance of the class that will use the named test\n",
      "     |      method when executed. Raises a ValueError if the instance does\n",
      "     |      not have a method with the specified name.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  __str__(self)\n",
      "     |      Return str(self).\n",
      "     |  \n",
      "     |  addCleanup(self, function, /, *args, **kwargs)\n",
      "     |      Add a function, with arguments, to be called when the test is\n",
      "     |      completed. Functions added are called on a LIFO basis and are\n",
      "     |      called after tearDown on test failure or success.\n",
      "     |      \n",
      "     |      Cleanup items are called even if setUp fails (unlike tearDown).\n",
      "     |  \n",
      "     |  addTypeEqualityFunc(self, typeobj, function)\n",
      "     |      Add a type specific assertEqual style function to compare a type.\n",
      "     |      \n",
      "     |      This method is for use by TestCase subclasses that need to register\n",
      "     |      their own type equality functions to provide nicer error messages.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          typeobj: The data type to call this function on when both values\n",
      "     |                  are of the same type in assertEqual().\n",
      "     |          function: The callable taking two arguments and an optional\n",
      "     |                  msg= argument that raises self.failureException with a\n",
      "     |                  useful error message when the two arguments are not equal.\n",
      "     |  \n",
      "     |  assertAlmostEqual(self, first, second, places=None, msg=None, delta=None)\n",
      "     |      Fail if the two objects are unequal as determined by their\n",
      "     |      difference rounded to the given number of decimal places\n",
      "     |      (default 7) and comparing to zero, or by comparing that the\n",
      "     |      difference between the two objects is more than the given\n",
      "     |      delta.\n",
      "     |      \n",
      "     |      Note that decimal places (from zero) are usually not the same\n",
      "     |      as significant digits (measured from the most significant digit).\n",
      "     |      \n",
      "     |      If the two objects compare equal then they will automatically\n",
      "     |      compare almost equal.\n",
      "     |  \n",
      "     |  assertAlmostEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertCountEqual(self, first, second, msg=None)\n",
      "     |      Asserts that two iterables have the same elements, the same number of\n",
      "     |      times, without regard to order.\n",
      "     |      \n",
      "     |          self.assertEqual(Counter(list(first)),\n",
      "     |                           Counter(list(second)))\n",
      "     |      \n",
      "     |       Example:\n",
      "     |          - [0, 1, 1] and [1, 0, 1] compare equal.\n",
      "     |          - [0, 0, 1] and [0, 1] compare unequal.\n",
      "     |  \n",
      "     |  assertDictContainsSubset(self, subset, dictionary, msg=None)\n",
      "     |      Checks whether dictionary is a superset of subset.\n",
      "     |  \n",
      "     |  assertDictEqual(self, d1, d2, msg=None)\n",
      "     |  \n",
      "     |  assertEqual(self, first, second, msg=None)\n",
      "     |      Fail if the two objects are unequal as determined by the '=='\n",
      "     |      operator.\n",
      "     |  \n",
      "     |  assertEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertFalse(self, expr, msg=None)\n",
      "     |      Check that the expression is false.\n",
      "     |  \n",
      "     |  assertGreater(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a > b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertGreaterEqual(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a >= b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIn(self, member, container, msg=None)\n",
      "     |      Just like self.assertTrue(a in b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIs(self, expr1, expr2, msg=None)\n",
      "     |      Just like self.assertTrue(a is b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsInstance(self, obj, cls, msg=None)\n",
      "     |      Same as self.assertTrue(isinstance(obj, cls)), with a nicer\n",
      "     |      default message.\n",
      "     |  \n",
      "     |  assertIsNone(self, obj, msg=None)\n",
      "     |      Same as self.assertTrue(obj is None), with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsNot(self, expr1, expr2, msg=None)\n",
      "     |      Just like self.assertTrue(a is not b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertIsNotNone(self, obj, msg=None)\n",
      "     |      Included for symmetry with assertIsNone.\n",
      "     |  \n",
      "     |  assertLess(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a < b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertLessEqual(self, a, b, msg=None)\n",
      "     |      Just like self.assertTrue(a <= b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertListEqual(self, list1, list2, msg=None)\n",
      "     |      A list-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          list1: The first list to compare.\n",
      "     |          list2: The second list to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertLogs(self, logger=None, level=None)\n",
      "     |      Fail unless a log message of level *level* or higher is emitted\n",
      "     |      on *logger_name* or its children.  If omitted, *level* defaults to\n",
      "     |      INFO and *logger* defaults to the root logger.\n",
      "     |      \n",
      "     |      This method must be used as a context manager, and will yield\n",
      "     |      a recording object with two attributes: `output` and `records`.\n",
      "     |      At the end of the context manager, the `output` attribute will\n",
      "     |      be a list of the matching formatted log messages and the\n",
      "     |      `records` attribute will be a list of the corresponding LogRecord\n",
      "     |      objects.\n",
      "     |      \n",
      "     |      Example::\n",
      "     |      \n",
      "     |          with self.assertLogs('foo', level='INFO') as cm:\n",
      "     |              logging.getLogger('foo').info('first message')\n",
      "     |              logging.getLogger('foo.bar').error('second message')\n",
      "     |          self.assertEqual(cm.output, ['INFO:foo:first message',\n",
      "     |                                       'ERROR:foo.bar:second message'])\n",
      "     |  \n",
      "     |  assertMultiLineEqual(self, first, second, msg=None)\n",
      "     |      Assert that two multi-line strings are equal.\n",
      "     |  \n",
      "     |  assertNotAlmostEqual(self, first, second, places=None, msg=None, delta=None)\n",
      "     |      Fail if the two objects are equal as determined by their\n",
      "     |      difference rounded to the given number of decimal places\n",
      "     |      (default 7) and comparing to zero, or by comparing that the\n",
      "     |      difference between the two objects is less than the given delta.\n",
      "     |      \n",
      "     |      Note that decimal places (from zero) are usually not the same\n",
      "     |      as significant digits (measured from the most significant digit).\n",
      "     |      \n",
      "     |      Objects that are equal automatically fail.\n",
      "     |  \n",
      "     |  assertNotAlmostEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertNotEqual(self, first, second, msg=None)\n",
      "     |      Fail if the two objects are equal as determined by the '!='\n",
      "     |      operator.\n",
      "     |  \n",
      "     |  assertNotEquals = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertNotIn(self, member, container, msg=None)\n",
      "     |      Just like self.assertTrue(a not in b), but with a nicer default message.\n",
      "     |  \n",
      "     |  assertNotIsInstance(self, obj, cls, msg=None)\n",
      "     |      Included for symmetry with assertIsInstance.\n",
      "     |  \n",
      "     |  assertNotRegex(self, text, unexpected_regex, msg=None)\n",
      "     |      Fail the test if the text matches the regular expression.\n",
      "     |  \n",
      "     |  assertNotRegexpMatches = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertRaises(self, expected_exception, *args, **kwargs)\n",
      "     |      Fail unless an exception of class expected_exception is raised\n",
      "     |      by the callable when invoked with specified positional and\n",
      "     |      keyword arguments. If a different type of exception is\n",
      "     |      raised, it will not be caught, and the test case will be\n",
      "     |      deemed to have suffered an error, exactly as for an\n",
      "     |      unexpected exception.\n",
      "     |      \n",
      "     |      If called with the callable and arguments omitted, will return a\n",
      "     |      context object used like this::\n",
      "     |      \n",
      "     |           with self.assertRaises(SomeException):\n",
      "     |               do_something()\n",
      "     |      \n",
      "     |      An optional keyword argument 'msg' can be provided when assertRaises\n",
      "     |      is used as a context object.\n",
      "     |      \n",
      "     |      The context manager keeps a reference to the exception as\n",
      "     |      the 'exception' attribute. This allows you to inspect the\n",
      "     |      exception after the assertion::\n",
      "     |      \n",
      "     |          with self.assertRaises(SomeException) as cm:\n",
      "     |              do_something()\n",
      "     |          the_exception = cm.exception\n",
      "     |          self.assertEqual(the_exception.error_code, 3)\n",
      "     |  \n",
      "     |  assertRaisesRegex(self, expected_exception, expected_regex, *args, **kwargs)\n",
      "     |      Asserts that the message in a raised exception matches a regex.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          expected_exception: Exception class expected to be raised.\n",
      "     |          expected_regex: Regex (re.Pattern object or string) expected\n",
      "     |                  to be found in error message.\n",
      "     |          args: Function to be called and extra positional args.\n",
      "     |          kwargs: Extra kwargs.\n",
      "     |          msg: Optional message used in case of failure. Can only be used\n",
      "     |                  when assertRaisesRegex is used as a context manager.\n",
      "     |  \n",
      "     |  assertRaisesRegexp = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertRegex(self, text, expected_regex, msg=None)\n",
      "     |      Fail the test unless the text matches the regular expression.\n",
      "     |  \n",
      "     |  assertRegexpMatches = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None)\n",
      "     |      An equality assertion for ordered sequences (like lists and tuples).\n",
      "     |      \n",
      "     |      For the purposes of this function, a valid ordered sequence type is one\n",
      "     |      which can be indexed, has a length, and has an equality operator.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          seq1: The first sequence to compare.\n",
      "     |          seq2: The second sequence to compare.\n",
      "     |          seq_type: The expected datatype of the sequences, or None if no\n",
      "     |                  datatype should be enforced.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertSetEqual(self, set1, set2, msg=None)\n",
      "     |      A set-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          set1: The first set to compare.\n",
      "     |          set2: The second set to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |      \n",
      "     |      assertSetEqual uses ducktyping to support different types of sets, and\n",
      "     |      is optimized for sets specifically (parameters must support a\n",
      "     |      difference method).\n",
      "     |  \n",
      "     |  assertTrue(self, expr, msg=None)\n",
      "     |      Check that the expression is true.\n",
      "     |  \n",
      "     |  assertTupleEqual(self, tuple1, tuple2, msg=None)\n",
      "     |      A tuple-specific equality assertion.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          tuple1: The first tuple to compare.\n",
      "     |          tuple2: The second tuple to compare.\n",
      "     |          msg: Optional message to use on failure instead of a list of\n",
      "     |                  differences.\n",
      "     |  \n",
      "     |  assertWarns(self, expected_warning, *args, **kwargs)\n",
      "     |      Fail unless a warning of class warnClass is triggered\n",
      "     |      by the callable when invoked with specified positional and\n",
      "     |      keyword arguments.  If a different type of warning is\n",
      "     |      triggered, it will not be handled: depending on the other\n",
      "     |      warning filtering rules in effect, it might be silenced, printed\n",
      "     |      out, or raised as an exception.\n",
      "     |      \n",
      "     |      If called with the callable and arguments omitted, will return a\n",
      "     |      context object used like this::\n",
      "     |      \n",
      "     |           with self.assertWarns(SomeWarning):\n",
      "     |               do_something()\n",
      "     |      \n",
      "     |      An optional keyword argument 'msg' can be provided when assertWarns\n",
      "     |      is used as a context object.\n",
      "     |      \n",
      "     |      The context manager keeps a reference to the first matching\n",
      "     |      warning as the 'warning' attribute; similarly, the 'filename'\n",
      "     |      and 'lineno' attributes give you information about the line\n",
      "     |      of Python code from which the warning was triggered.\n",
      "     |      This allows you to inspect the warning after the assertion::\n",
      "     |      \n",
      "     |          with self.assertWarns(SomeWarning) as cm:\n",
      "     |              do_something()\n",
      "     |          the_warning = cm.warning\n",
      "     |          self.assertEqual(the_warning.some_attribute, 147)\n",
      "     |  \n",
      "     |  assertWarnsRegex(self, expected_warning, expected_regex, *args, **kwargs)\n",
      "     |      Asserts that the message in a triggered warning matches a regexp.\n",
      "     |      Basic functioning is similar to assertWarns() with the addition\n",
      "     |      that only warnings whose messages also match the regular expression\n",
      "     |      are considered successful matches.\n",
      "     |      \n",
      "     |      Args:\n",
      "     |          expected_warning: Warning class expected to be triggered.\n",
      "     |          expected_regex: Regex (re.Pattern object or string) expected\n",
      "     |                  to be found in error message.\n",
      "     |          args: Function to be called and extra positional args.\n",
      "     |          kwargs: Extra kwargs.\n",
      "     |          msg: Optional message used in case of failure. Can only be used\n",
      "     |                  when assertWarnsRegex is used as a context manager.\n",
      "     |  \n",
      "     |  assert_ = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  countTestCases(self)\n",
      "     |  \n",
      "     |  debug(self)\n",
      "     |      Run the test without collecting errors in a TestResult\n",
      "     |  \n",
      "     |  defaultTestResult(self)\n",
      "     |  \n",
      "     |  doCleanups(self)\n",
      "     |      Execute all cleanup functions. Normally called for you after\n",
      "     |      tearDown.\n",
      "     |  \n",
      "     |  fail(self, msg=None)\n",
      "     |      Fail immediately, with the given message.\n",
      "     |  \n",
      "     |  failIf = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failIfAlmostEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failIfEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnless = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessAlmostEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessEqual = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  failUnlessRaises = deprecated_func(*args, **kwargs)\n",
      "     |  \n",
      "     |  id(self)\n",
      "     |  \n",
      "     |  run(self, result=None)\n",
      "     |  \n",
      "     |  setUp(self)\n",
      "     |      Hook method for setting up the test fixture before exercising it.\n",
      "     |  \n",
      "     |  shortDescription(self)\n",
      "     |      Returns a one-line description of the test, or None if no\n",
      "     |      description has been provided.\n",
      "     |      \n",
      "     |      The default implementation of this method returns the first line of\n",
      "     |      the specified test method's docstring.\n",
      "     |  \n",
      "     |  skipTest(self, reason)\n",
      "     |      Skip this test.\n",
      "     |  \n",
      "     |  subTest(self, msg=<object object at 0x000001FAF6959550>, **params)\n",
      "     |      Return a context manager that will return the enclosed block\n",
      "     |      of code in a subtest identified by the optional message and\n",
      "     |      keyword parameters.  A failure in the subtest marks the test\n",
      "     |      case as failed but resumes execution at the end of the enclosed\n",
      "     |      block, allowing further test code to be executed.\n",
      "     |  \n",
      "     |  tearDown(self)\n",
      "     |      Hook method for deconstructing the test fixture after testing it.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods defined here:\n",
      "     |  \n",
      "     |  addClassCleanup(function, /, *args, **kwargs) from builtins.type\n",
      "     |      Same as addCleanup, except the cleanup items are called even if\n",
      "     |      setUpClass fails (unlike tearDownClass).\n",
      "     |  \n",
      "     |  doClassCleanups() from builtins.type\n",
      "     |      Execute all class cleanup functions. Normally called for you after\n",
      "     |      tearDownClass.\n",
      "     |  \n",
      "     |  setUpClass() from builtins.type\n",
      "     |      Hook method for setting up class fixture before running tests in the class.\n",
      "     |  \n",
      "     |  tearDownClass() from builtins.type\n",
      "     |      Hook method for deconstructing the class fixture after running all tests in the class.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  failureException = <class 'AssertionError'>\n",
      "     |      Assertion failed.\n",
      "     |  \n",
      "     |  longMessage = True\n",
      "     |  \n",
      "     |  maxDiff = 640\n",
      "    \n",
      "    class TestLoader(builtins.object)\n",
      "     |  This class is responsible for loading tests according to various criteria\n",
      "     |  and returning them wrapped in a TestSuite\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  discover(self, start_dir, pattern='test*.py', top_level_dir=None)\n",
      "     |      Find and return all test modules from the specified start\n",
      "     |      directory, recursing into subdirectories to find them and return all\n",
      "     |      tests found within them. Only test files that match the pattern will\n",
      "     |      be loaded. (Using shell style pattern matching.)\n",
      "     |      \n",
      "     |      All test modules must be importable from the top level of the project.\n",
      "     |      If the start directory is not the top level directory then the top\n",
      "     |      level directory must be specified separately.\n",
      "     |      \n",
      "     |      If a test package name (directory with '__init__.py') matches the\n",
      "     |      pattern then the package will be checked for a 'load_tests' function. If\n",
      "     |      this exists then it will be called with (loader, tests, pattern) unless\n",
      "     |      the package has already had load_tests called from the same discovery\n",
      "     |      invocation, in which case the package module object is not scanned for\n",
      "     |      tests - this ensures that when a package uses discover to further\n",
      "     |      discover child tests that infinite recursion does not happen.\n",
      "     |      \n",
      "     |      If load_tests exists then discovery does *not* recurse into the package,\n",
      "     |      load_tests is responsible for loading all tests in the package.\n",
      "     |      \n",
      "     |      The pattern is deliberately not stored as a loader attribute so that\n",
      "     |      packages can continue discovery themselves. top_level_dir is stored so\n",
      "     |      load_tests does not need to pass this argument in to loader.discover().\n",
      "     |      \n",
      "     |      Paths are sorted before being imported to ensure reproducible execution\n",
      "     |      order even on filesystems with non-alphabetical ordering like ext3/4.\n",
      "     |  \n",
      "     |  getTestCaseNames(self, testCaseClass)\n",
      "     |      Return a sorted sequence of method names found within testCaseClass\n",
      "     |  \n",
      "     |  loadTestsFromModule(self, module, *args, pattern=None, **kws)\n",
      "     |      Return a suite of all test cases contained in the given module\n",
      "     |  \n",
      "     |  loadTestsFromName(self, name, module=None)\n",
      "     |      Return a suite of all test cases given a string specifier.\n",
      "     |      \n",
      "     |      The name may resolve either to a module, a test case class, a\n",
      "     |      test method within a test case class, or a callable object which\n",
      "     |      returns a TestCase or TestSuite instance.\n",
      "     |      \n",
      "     |      The method optionally resolves the names relative to a given module.\n",
      "     |  \n",
      "     |  loadTestsFromNames(self, names, module=None)\n",
      "     |      Return a suite of all test cases found using the given sequence\n",
      "     |      of string specifiers. See 'loadTestsFromName()'.\n",
      "     |  \n",
      "     |  loadTestsFromTestCase(self, testCaseClass)\n",
      "     |      Return a suite of all test cases contained in testCaseClass\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  sortTestMethodsUsing = three_way_cmp(x, y)\n",
      "     |      Return -1 if x < y, 0 if x == y and 1 if x > y\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  suiteClass = <class 'unittest.suite.TestSuite'>\n",
      "     |      A test suite is a composite test consisting of a number of TestCases.\n",
      "     |      \n",
      "     |      For use, create an instance of TestSuite, then add test case instances.\n",
      "     |      When all tests have been added, the suite can be passed to a test\n",
      "     |      runner, such as TextTestRunner. It will run the individual test cases\n",
      "     |      in the order in which they were added, aggregating the results. When\n",
      "     |      subclassing, do not forget to call the base class constructor.\n",
      "     |  \n",
      "     |  testMethodPrefix = 'test'\n",
      "     |  \n",
      "     |  testNamePatterns = None\n",
      "    \n",
      "    class TestResult(builtins.object)\n",
      "     |  TestResult(stream=None, descriptions=None, verbosity=None)\n",
      "     |  \n",
      "     |  Holder for test result information.\n",
      "     |  \n",
      "     |  Test results are automatically managed by the TestCase and TestSuite\n",
      "     |  classes, and do not need to be explicitly manipulated by writers of tests.\n",
      "     |  \n",
      "     |  Each instance holds the total number of tests run, and collections of\n",
      "     |  failures and errors that occurred among those test runs. The collections\n",
      "     |  contain tuples of (testcase, exceptioninfo), where exceptioninfo is the\n",
      "     |  formatted traceback of the error that occurred.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, stream=None, descriptions=None, verbosity=None)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  addError(self, test, err)\n",
      "     |      Called when an error has occurred. 'err' is a tuple of values as\n",
      "     |      returned by sys.exc_info().\n",
      "     |  \n",
      "     |  addExpectedFailure(self, test, err)\n",
      "     |      Called when an expected failure/error occurred.\n",
      "     |  \n",
      "     |  addFailure(self, test, err)\n",
      "     |      Called when an error has occurred. 'err' is a tuple of values as\n",
      "     |      returned by sys.exc_info().\n",
      "     |  \n",
      "     |  addSkip(self, test, reason)\n",
      "     |      Called when a test is skipped.\n",
      "     |  \n",
      "     |  addSubTest(self, test, subtest, err)\n",
      "     |      Called at the end of a subtest.\n",
      "     |      'err' is None if the subtest ended successfully, otherwise it's a\n",
      "     |      tuple of values as returned by sys.exc_info().\n",
      "     |  \n",
      "     |  addSuccess(self, test)\n",
      "     |      Called when a test has completed successfully\n",
      "     |  \n",
      "     |  addUnexpectedSuccess(self, test)\n",
      "     |      Called when a test was expected to fail, but succeed.\n",
      "     |  \n",
      "     |  printErrors(self)\n",
      "     |      Called by TestRunner after test run\n",
      "     |  \n",
      "     |  startTest(self, test)\n",
      "     |      Called when the given test is about to be run\n",
      "     |  \n",
      "     |  startTestRun(self)\n",
      "     |      Called once before any tests are executed.\n",
      "     |      \n",
      "     |      See startTest for a method called before each test.\n",
      "     |  \n",
      "     |  stop(self)\n",
      "     |      Indicates that the tests should be aborted.\n",
      "     |  \n",
      "     |  stopTest(self, test)\n",
      "     |      Called when the given test has been run\n",
      "     |  \n",
      "     |  stopTestRun(self)\n",
      "     |      Called once after all tests are executed.\n",
      "     |      \n",
      "     |      See stopTest for a method called after each test.\n",
      "     |  \n",
      "     |  wasSuccessful(self)\n",
      "     |      Tells whether or not this result was a success.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class TestSuite(BaseTestSuite)\n",
      "     |  TestSuite(tests=())\n",
      "     |  \n",
      "     |  A test suite is a composite test consisting of a number of TestCases.\n",
      "     |  \n",
      "     |  For use, create an instance of TestSuite, then add test case instances.\n",
      "     |  When all tests have been added, the suite can be passed to a test\n",
      "     |  runner, such as TextTestRunner. It will run the individual test cases\n",
      "     |  in the order in which they were added, aggregating the results. When\n",
      "     |  subclassing, do not forget to call the base class constructor.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      TestSuite\n",
      "     |      BaseTestSuite\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  debug(self)\n",
      "     |      Run the tests without collecting errors in a TestResult\n",
      "     |  \n",
      "     |  run(self, result, debug=False)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from BaseTestSuite:\n",
      "     |  \n",
      "     |  __call__(self, *args, **kwds)\n",
      "     |      Call self as a function.\n",
      "     |  \n",
      "     |  __eq__(self, other)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __init__(self, tests=())\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  __iter__(self)\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  addTest(self, test)\n",
      "     |  \n",
      "     |  addTests(self, tests)\n",
      "     |  \n",
      "     |  countTestCases(self)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from BaseTestSuite:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes inherited from BaseTestSuite:\n",
      "     |  \n",
      "     |  __hash__ = None\n",
      "    \n",
      "    class TextTestResult(unittest.result.TestResult)\n",
      "     |  TextTestResult(stream, descriptions, verbosity)\n",
      "     |  \n",
      "     |  A test result class that can print formatted text results to a stream.\n",
      "     |  \n",
      "     |  Used by TextTestRunner.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      TextTestResult\n",
      "     |      unittest.result.TestResult\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, stream, descriptions, verbosity)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  addError(self, test, err)\n",
      "     |      Called when an error has occurred. 'err' is a tuple of values as\n",
      "     |      returned by sys.exc_info().\n",
      "     |  \n",
      "     |  addExpectedFailure(self, test, err)\n",
      "     |      Called when an expected failure/error occurred.\n",
      "     |  \n",
      "     |  addFailure(self, test, err)\n",
      "     |      Called when an error has occurred. 'err' is a tuple of values as\n",
      "     |      returned by sys.exc_info().\n",
      "     |  \n",
      "     |  addSkip(self, test, reason)\n",
      "     |      Called when a test is skipped.\n",
      "     |  \n",
      "     |  addSuccess(self, test)\n",
      "     |      Called when a test has completed successfully\n",
      "     |  \n",
      "     |  addUnexpectedSuccess(self, test)\n",
      "     |      Called when a test was expected to fail, but succeed.\n",
      "     |  \n",
      "     |  getDescription(self, test)\n",
      "     |  \n",
      "     |  printErrorList(self, flavour, errors)\n",
      "     |  \n",
      "     |  printErrors(self)\n",
      "     |      Called by TestRunner after test run\n",
      "     |  \n",
      "     |  startTest(self, test)\n",
      "     |      Called when the given test is about to be run\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  separator1 = '========================================================...\n",
      "     |  \n",
      "     |  separator2 = '--------------------------------------------------------...\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from unittest.result.TestResult:\n",
      "     |  \n",
      "     |  __repr__(self)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  addSubTest(self, test, subtest, err)\n",
      "     |      Called at the end of a subtest.\n",
      "     |      'err' is None if the subtest ended successfully, otherwise it's a\n",
      "     |      tuple of values as returned by sys.exc_info().\n",
      "     |  \n",
      "     |  startTestRun(self)\n",
      "     |      Called once before any tests are executed.\n",
      "     |      \n",
      "     |      See startTest for a method called before each test.\n",
      "     |  \n",
      "     |  stop(self)\n",
      "     |      Indicates that the tests should be aborted.\n",
      "     |  \n",
      "     |  stopTest(self, test)\n",
      "     |      Called when the given test has been run\n",
      "     |  \n",
      "     |  stopTestRun(self)\n",
      "     |      Called once after all tests are executed.\n",
      "     |      \n",
      "     |      See stopTest for a method called after each test.\n",
      "     |  \n",
      "     |  wasSuccessful(self)\n",
      "     |      Tells whether or not this result was a success.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors inherited from unittest.result.TestResult:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "    \n",
      "    class TextTestRunner(builtins.object)\n",
      "     |  TextTestRunner(stream=None, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None, warnings=None, *, tb_locals=False)\n",
      "     |  \n",
      "     |  A test runner class that displays results in textual form.\n",
      "     |  \n",
      "     |  It prints out the names of tests as they are run, errors as they\n",
      "     |  occur, and a summary of the results at the end of the test run.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, stream=None, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None, warnings=None, *, tb_locals=False)\n",
      "     |      Construct a TextTestRunner.\n",
      "     |      \n",
      "     |      Subclasses should accept **kwargs to ensure compatibility as the\n",
      "     |      interface changes.\n",
      "     |  \n",
      "     |  run(self, test)\n",
      "     |      Run the given test case or test suite.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  resultclass = <class 'unittest.runner.TextTestResult'>\n",
      "     |      A test result class that can print formatted text results to a stream.\n",
      "     |      \n",
      "     |      Used by TextTestRunner.\n",
      "    \n",
      "    main = class TestProgram(builtins.object)\n",
      "     |  main(module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=<unittest.loader.TestLoader object at 0x000001FAF6D0D5E0>, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None, warnings=None, *, tb_locals=False)\n",
      "     |  \n",
      "     |  A command-line program that runs a set of tests; this is primarily\n",
      "     |  for making test modules conveniently executable.\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=<unittest.loader.TestLoader object at 0x000001FAF6D0D5E0>, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None, warnings=None, *, tb_locals=False)\n",
      "     |      Initialize self.  See help(type(self)) for accurate signature.\n",
      "     |  \n",
      "     |  createTests(self, from_discovery=False, Loader=None)\n",
      "     |  \n",
      "     |  parseArgs(self, argv)\n",
      "     |  \n",
      "     |  runTests(self)\n",
      "     |  \n",
      "     |  usageExit(self, msg=None)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  __dict__\n",
      "     |      dictionary for instance variables (if defined)\n",
      "     |  \n",
      "     |  __weakref__\n",
      "     |      list of weak references to the object (if defined)\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  buffer = None\n",
      "     |  \n",
      "     |  catchbreak = None\n",
      "     |  \n",
      "     |  failfast = None\n",
      "     |  \n",
      "     |  module = None\n",
      "     |  \n",
      "     |  progName = None\n",
      "     |  \n",
      "     |  testNamePatterns = None\n",
      "     |  \n",
      "     |  verbosity = 1\n",
      "     |  \n",
      "     |  warnings = None\n",
      "\n",
      "FUNCTIONS\n",
      "    addModuleCleanup(function, /, *args, **kwargs)\n",
      "        Same as addCleanup, except the cleanup items are called even if\n",
      "        setUpModule fails (unlike tearDownModule).\n",
      "    \n",
      "    expectedFailure(test_item)\n",
      "    \n",
      "    findTestCases(module, prefix='test', sortUsing=<function three_way_cmp at 0x000001FAF6CEC040>, suiteClass=<class 'unittest.suite.TestSuite'>)\n",
      "    \n",
      "    getTestCaseNames(testCaseClass, prefix, sortUsing=<function three_way_cmp at 0x000001FAF6CEC040>, testNamePatterns=None)\n",
      "    \n",
      "    installHandler()\n",
      "    \n",
      "    makeSuite(testCaseClass, prefix='test', sortUsing=<function three_way_cmp at 0x000001FAF6CEC040>, suiteClass=<class 'unittest.suite.TestSuite'>)\n",
      "    \n",
      "    registerResult(result)\n",
      "    \n",
      "    removeHandler(method=None)\n",
      "    \n",
      "    removeResult(result)\n",
      "    \n",
      "    skip(reason)\n",
      "        Unconditionally skip a test.\n",
      "    \n",
      "    skipIf(condition, reason)\n",
      "        Skip a test if the condition is true.\n",
      "    \n",
      "    skipUnless(condition, reason)\n",
      "        Skip a test unless the condition is true.\n",
      "\n",
      "DATA\n",
      "    __all__ = ['TestResult', 'TestCase', 'IsolatedAsyncioTestCase', 'TestS...\n",
      "    defaultTestLoader = <unittest.loader.TestLoader object>\n",
      "\n",
      "FILE\n",
      "    c:\\programdata\\anaconda3\\lib\\unittest\\__init__.py\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import unittest  # unittest可以在一个独立的文件里提供一个更全面的测试集\n",
    "help(unittest)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "626e6b21",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
